CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataCnv Class Reference

#include <RawDataCnv.h>

+ Inheritance diagram for RawDataCnv:

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.
 
- Public Member Functions inherited from RawDataBaseCnv
 RawDataBaseCnv (ISvcLocator *svc)
 
 RawDataBaseCnv (unsigned char storageType, const CLID &clid, ISvcLocator *svc)
 
virtual ~RawDataBaseCnv ()
 
StatusCode initialize ()
 
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.
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
static const unsigned char storageType ()
 
- Static Public Member Functions inherited from RawDataBaseCnv
static const long storageType ()
 
static const CLID & classID ()
 

Protected Member Functions

 RawDataCnv (ISvcLocator *svc)
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< RawDataCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RawDataBaseCnv
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.
 

Detailed Description

Definition at line 29 of file RawDataCnv.h.

Constructor & Destructor Documentation

◆ RawDataCnv()

RawDataCnv::RawDataCnv ( ISvcLocator * svc)
protected

Definition at line 27 of file RawDataCnv.cxx.

27 :
29{
30 //init();
31}
unsigned const long PACKEDRAWEVENT_StorageType
RawDataBaseCnv(ISvcLocator *svc)
static const CLID & classID()

Member Function Documentation

◆ classID()

const CLID & RawDataCnv::classID ( )
static

Definition at line 83 of file RawDataCnv.cxx.

84{
85 return CLID_Event;
86}
const CLID & CLID_Event

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

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

Definition at line 98 of file RawDataCnv.cxx.

99{
100 RawDataAddress *pEFAddr;
101 const RAWEVENT *evt;
102
103 Event::EventH * evh = new Event::EventH();
104 pObj = evh;
105
106 if ( (pEFAddr = dynamic_cast<RawDataAddress*>(pAddr)) ) {
107 evt = m_inputSvc->currentEvent();
108 if (evt == NULL) return StatusCode::FAILURE;
109 return StatusCode::SUCCESS;
110 }
111 else {
112 return StatusCode::FAILURE;
113 }
114}
virtual RAWEVENT * currentEvent()=0

◆ createRep()

StatusCode RawDataCnv::createRep ( DataObject * pObject,
IOpaqueAddress *& refpAddress )
virtual

Convert the transient object to the requested representation.

Reimplemented from RawDataBaseCnv.

Definition at line 116 of file RawDataCnv.cxx.

117{
118 Event::EventH * evh=dynamic_cast<Event::EventH *> (pObj);
119 if (!evh) {
120 std::string RawDataCnv_Name("RawDataCnv");
121 //ConversionSvc* pCnvSvc = 0;
122 //SmartIF<IService> pCnvSvc(conversionSvc());
123 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
124 SmartIF<IService> pCnvSvc(conversionSvc());
125 if (isGaudiThreaded(pCnvSvc->name())){
126 RawDataCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
127 }
128 //}
129 MsgStream log(msgSvc(), RawDataCnv_Name.c_str());
130 log << MSG::DEBUG << "RawDataCnv::createRep()" << endreq;
131
132 log << MSG::ERROR << "Could not downcast Event" << endreq;
133 return StatusCode::FAILURE;
134 }
135 // nothing to do, will be done in lower converters
136 return StatusCode::SUCCESS;
137}
IMessageSvc * msgSvc()

◆ initialize()

StatusCode RawDataCnv::initialize ( )

Definition at line 33 of file RawDataCnv.cxx.

34{
35 StatusCode sc = RawDataBaseCnv::initialize();
36 if( sc.isFailure() ) return sc;
37
38 std::string PackedRawDataCnvSvc_Name("PackedRawDataCnvSvc");
39 std::string RawDataInputSvc_Name("RawDataInputSvc");
40 std::string RawDataCnv_Name("RawDataCnv");
41
42 // for Mutil-thread by tianhl
43 //ConversionSvc* pCnvSvc = 0;
44 //SmartIF<IService> pCnvSvc(conversionSvc());
45 //if (pCnvSvc = dynamic_cast<ConversionSvc*>(conversionSvc())){
46 SmartIF<IService> pCnvSvc(conversionSvc());
47 if (isGaudiThreaded(pCnvSvc->name())){
48 PackedRawDataCnvSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
49 RawDataInputSvc_Name += getGaudiThreadIDfromName(pCnvSvc->name());
50 RawDataCnv_Name += getGaudiThreadIDfromName(pCnvSvc->name());
51 }
52 //}
53 // for Mutil-thread by tianhl
54
55 MsgStream log(messageService(), RawDataCnv_Name.c_str());
56 /*if (StatusCode::SUCCESS != service("PackedRawDataCnvSvc",
57 m_RawDataAccess) || !m_RawDataAccess )
58 {
59 log << MSG::ERROR << " Can't get RawDataAccess interface "
60 << endreq;
61 return StatusCode::FAILURE;
62 }
63 log << MSG::INFO << " RawDataCnvSvc retrieved "<< endreq; */
64
65 IService* svc ;
66 sc = serviceLocator()->getService(RawDataInputSvc_Name.c_str(), svc);
67 if(sc != StatusCode::SUCCESS ) {
68 log<<MSG::WARNING << " Cant get RawDataInputSvc " <<endreq;
69 return sc ;
70 }
71
72 m_inputSvc = dynamic_cast<RawDataInputSvc*> (svc);
73 if(m_inputSvc == 0 ) {
74 log<<MSG::WARNING << " Cant cast to RawDataInputSvc " <<endreq;
75 return StatusCode::FAILURE ;
76 }
77
78 return StatusCode::SUCCESS;
79}
StatusCode initialize()

◆ repSvcType()

virtual long RawDataCnv::repSvcType ( ) const
inlinevirtual

Reimplemented from RawDataBaseCnv.

Definition at line 44 of file RawDataCnv.h.

44 {
46 }

◆ storageType()

static const unsigned char RawDataCnv::storageType ( )
inlinestatic

Definition at line 48 of file RawDataCnv.h.

48 {
50 }

◆ updateObj()

StatusCode RawDataCnv::updateObj ( IOpaqueAddress * pAddr,
DataObject * pObj )
virtual

override the RawDataBaseCnv version

Definition at line 88 of file RawDataCnv.cxx.

88 {
89 // Purpose and Method: This method does nothing other than announce it has
90 // been called.
91
92 //MsgStream log(msgSvc(), "RawDataCnv");
93 //log << MSG::DEBUG << "RawDataCnv::updateObj" << endreq;
94 return Converter::updateObj(pAddr, pObj);
95}

Friends And Related Symbol Documentation

◆ CnvFactory< RawDataCnv >

friend class CnvFactory< RawDataCnv >
friend

Definition at line 1 of file RawDataCnv.h.


The documentation for this class was generated from the following files: