#include <RawDataMcCnv.h>
Inheritance diagram for RawDataMcCnv:
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. | |
destination * | operator (const source &) const |
Static Public Member Functions | |
static const CLID & | classID () |
static const unsigned char | storageType () |
Protected Member Functions | |
RawDataMcCnv (ISvcLocator *svc) | |
virtual destination * | convert (const source &) const =0 |
Protected Attributes | |
IRawDataCnvSvc * | m_CnvSvc |
Pointer to event conversion service interface. | |
std::vector< IRawDataCnvSvc::Leaf > | m_leaves |
Leaf objects giving the locations of the objects in the data store. | |
Private Attributes | |
IRawDataInputSvc * | m_inputSvc |
IRawDataCnvSvc * | m_RawDataAccess |
Define the interface to raw data cnv. | |
Friends | |
class | CnvFactory< RawDataMcCnv > |
Definition at line 31 of file RawDataMcCnv.h.
typedef Ty2 Converter< Ty1, Ty2 >::destination [inherited] |
Definition at line 19 of file Converter.h.
Definition at line 18 of file Converter.h.
RawDataMcCnv::RawDataMcCnv | ( | ISvcLocator * | svc | ) | [protected] |
Definition at line 27 of file RawDataMcCnv.cxx.
00027 : 00028 RawDataBaseCnv(PACKEDRAWEVENT_StorageType, classID(), svc) 00029 { 00030 //init(); 00031 }
const CLID & RawDataMcCnv::classID | ( | ) | [static] |
Reimplemented from RawDataBaseCnv.
Definition at line 35 of file RawDataMcCnv.cxx.
References CLID_McEvent.
Referenced by PackedRawDataCnvSvc::addConverters(), and createRep().
00036 { 00037 return CLID_McEvent; 00038 }
virtual destination* Converter< Ty1, Ty2 >::convert | ( | const source & | ) | const [protected, pure virtual, inherited] |
StatusCode RawDataMcCnv::createObj | ( | IOpaqueAddress * | pAddr, | |
DataObject *& | pObj | |||
) |
Definition at line 105 of file RawDataMcCnv.cxx.
00106 { 00107 //MsgStream log(msgSvc(), "RawDataMcCnv"); 00108 00109 McEvent *mcEvent = new McEvent; 00110 pObj = mcEvent; 00111 00112 return StatusCode::SUCCESS; 00113 00114 }
StatusCode RawDataMcCnv::createRep | ( | DataObject * | pObj, | |
IOpaqueAddress *& | pAddr | |||
) | [virtual] |
Convert the transient object to the requested representation.
Reimplemented from RawDataBaseCnv.
Definition at line 116 of file RawDataMcCnv.cxx.
References classID(), and deljobs::string.
00117 { 00118 // convert PixelRaw in the container into ByteStream 00119 //MsgStream log(messageService(), "RawDataMcCnv"); 00120 00121 std::string nm = pObj->registry()->name(); 00122 00123 RawDataAddress* addr = new RawDataAddress(classID(), nm, ""); 00124 00125 pAddr = addr; 00126 00127 return StatusCode::SUCCESS; 00128 }
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 RawDataMcCnv::initialize | ( | ) |
Reimplemented from RawDataBaseCnv.
Definition at line 40 of file RawDataMcCnv.cxx.
References calibUtil::ERROR, RawDataBaseCnv::initialize(), m_inputSvc, m_RawDataAccess, deljobs::string, and Bes_Common::WARNING.
00041 { 00042 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc"); 00043 std::string RawDataInputSvc_Name("RawDataInputSvc"); 00044 std::string RawDataMcCnv_Name("RawDataMcCnv"); 00045 00046 // for Mutil-thread by tianhl 00047 //ConversionSvc* pCnvSvc = 0; 00048 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){ 00049 SmartIF<IService> pCnvSvc(conversionSvc()); 00050 if (isGaudiThreaded(pCnvSvc->name())){ 00051 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00052 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00053 RawDataMcCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name()); 00054 } 00055 //} 00056 00057 00058 MsgStream log(messageService(), RawDataMcCnv_Name.c_str()); 00059 00060 StatusCode sc = RawDataBaseCnv::initialize(); 00061 if (StatusCode::SUCCESS != sc) { 00062 log << MSG::ERROR << "RawDataBaseCnv: Cant initialize PackedRawDataCnvSvc" << endreq; 00063 return sc; 00064 } 00065 00066 // Check RawDataCnvSvc 00067 IService* isvc = 0; 00068 sc = serviceLocator()->service(PackedRawDataCnvSvc_Name.c_str(), isvc, true); 00069 if (sc != StatusCode::SUCCESS) { 00070 log << MSG::ERROR << "Cant get PackedRawDataCnvSvc" << endreq; 00071 } 00072 00073 m_RawDataAccess = dynamic_cast<PackedRawDataCnvSvc*> (isvc); 00074 if (m_RawDataAccess == 0 ) { 00075 log << MSG::ERROR << "RawDataMdcCnv: Cant cast to RawDataCnvSvc " << endreq; 00076 return StatusCode::FAILURE; 00077 } 00078 00079 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), isvc); 00080 if (sc != StatusCode::SUCCESS ) { 00081 log << MSG::WARNING << "Cant get RawDataInputSvc " << endreq; 00082 return sc ; 00083 } 00084 00085 m_inputSvc = dynamic_cast<RawDataInputSvc*> (isvc); 00086 if (m_inputSvc == 0 ) { 00087 log << MSG::ERROR << "Cant cast to RawDataInputSvc " << endreq; 00088 return StatusCode::FAILURE ; 00089 } 00090 00091 return StatusCode::SUCCESS; 00092 }
destination* Converter< Ty1, Ty2 >::operator | ( | const source & | ) | const [inline, inherited] |
virtual long RawDataMcCnv::repSvcType | ( | ) | const [inline, virtual] |
Reimplemented from RawDataBaseCnv.
Definition at line 45 of file RawDataMcCnv.h.
References PACKEDRAWEVENT_StorageType.
00045 { 00046 return PACKEDRAWEVENT_StorageType; 00047 }
static const unsigned char RawDataMcCnv::storageType | ( | ) | [inline, static] |
Reimplemented from RawDataBaseCnv.
Definition at line 49 of file RawDataMcCnv.h.
References PACKEDRAWEVENT_StorageType.
00049 { 00050 return PACKEDRAWEVENT_StorageType; 00051 }
StatusCode RawDataMcCnv::updateObj | ( | IOpaqueAddress * | , | |
DataObject * | ||||
) | [virtual] |
override the RawDataBaseCnv version
Definition at line 95 of file RawDataMcCnv.cxx.
00095 { 00096 // Purpose and Method: This method does nothing other than announce it has 00097 // been called. 00098 00099 //MsgStream log(msgSvc(), "RawDataMcCnv"); 00100 //log << MSG::DEBUG << "RawDataMcCnv::updateObj" << endreq; 00101 return Converter::updateObj(pAddr, pObj); 00102 }
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 }
friend class CnvFactory< RawDataMcCnv > [friend] |
Definition at line 35 of file RawDataMcCnv.h.
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* RawDataMcCnv::m_inputSvc [private] |
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* RawDataMcCnv::m_RawDataAccess [private] |
Define the interface to raw data cnv.
Definition at line 64 of file RawDataMcCnv.h.
Referenced by initialize().