BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataCnv.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "EventModel/Event.h"
4#include "RawDataCnv/EventManagement/RAWEVENT.h"
5#include "RawDataCnv/RawDataAddress.h"
6
7#include "RawDataBaseCnv.h"
8
9extern const CLID& CLID_Event;
10
11class RawDataCnv : public RawDataBaseCnv {
12public:
13 RawDataCnv( ISvcLocator* svc )
15
16 static const CLID& classID() { return CLID_Event; }
17
18 // Create a converted object in the Transient Data Store.
19 StatusCode createObj( IOpaqueAddress* pAddr, DataObject*& pObj ) {
20 RawDataAddress* pEFAddr;
21 const RAWEVENT* evt;
22
23 Event::EventH* evh = new Event::EventH();
24
25 pObj = evh;
26 if ( ( pEFAddr = dynamic_cast<RawDataAddress*>( pAddr ) ) )
27 {
28 evt = m_inputSvc->currentEvent();
29 if ( !evt ) return StatusCode::FAILURE;
30 return StatusCode::SUCCESS;
31 }
32 else return StatusCode::FAILURE;
33 }
34
35 StatusCode createRep( DataObject* pObj, IOpaqueAddress*& pAddr ) {
36 MsgStream log( msgSvc(), "RawDataCnv" );
37 log << MSG::DEBUG << "RawDataCnv::createRep()" << endmsg;
38
39 Event::EventH* evh = dynamic_cast<Event::EventH*>( pObj );
40 if ( !evh )
41 {
42 log << MSG::ERROR << "Could not downcast Event" << endmsg;
43 return StatusCode::FAILURE;
44 }
45
46 // nothing to do, will be done in lower converters
47 return StatusCode::SUCCESS;
48 }
49};
const CLID & CLID_Event
const CLID & CLID_Event
IMessageSvc * msgSvc()
IRawDataInputSvc * m_inputSvc
RawDataBaseCnv(long storageType, const CLID &clid, ISvcLocator *svc)
static const CLID & classID()
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
RawDataCnv(ISvcLocator *svc)