BOSS 7.0.8
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 ()
 
virtual long repSvcType () const
 
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 createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
 
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 29 of file RawDataCnv.cxx.

29 :
31{
32 //init();
33}
unsigned const long PACKEDRAWEVENT_StorageType
Definition: ClassID_temp.h:17
static const CLID & classID()
Definition: RawDataCnv.cxx:85

Member Function Documentation

◆ classID()

const CLID & RawDataCnv::classID ( )
static

Definition at line 85 of file RawDataCnv.cxx.

86{
87 return CLID_Event;
88}
const CLID & CLID_Event
Definition: EventModel.cxx:193

Referenced by PackedRawDataCnvSvc::addConverters().

◆ createObj()

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

Definition at line 100 of file RawDataCnv.cxx.

101{
102 RawDataAddress *pEFAddr;
103 const RAWEVENT *evt;
104
105 Event::EventH * evh = new Event::EventH();
106 pObj = evh;
107
108 if ( (pEFAddr = dynamic_cast<RawDataAddress*>(pAddr)) ) {
109 evt = m_inputSvc->currentEvent();
110 if (evt == NULL) return StatusCode::FAILURE;
111 return StatusCode::SUCCESS;
112 }
113 else {
114 return StatusCode::FAILURE;
115 }
116}
#define NULL
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 118 of file RawDataCnv.cxx.

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

◆ initialize()

StatusCode RawDataCnv::initialize ( )

Definition at line 35 of file RawDataCnv.cxx.

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

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

Friends And Related Function 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: