BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
PackedRawDataCnvSvc Class Reference

#include <PackedRawDataCnvSvc.h>

+ Inheritance diagram for PackedRawDataCnvSvc:

Public Member Functions

 PackedRawDataCnvSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor.
 
virtual ~PackedRawDataCnvSvc ()
 Standard Destructor.
 
virtual StatusCode initialize ()
 Initialize the service.
 
virtual StatusCode updateServiceState (IOpaqueAddress *pAddress)
 Update state of the service.
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 Override inherited queryInterface.
 
virtual StatusCode connectOutput (const std::string &t)
 
virtual StatusCode connectOutput (const std::string &t, const std::string &)
 
virtual StatusCode commitOutput (const std::string &t, bool b)
 
virtual WriteRawEvent *& getRawEvent ()
 
 PackedRawDataCnvSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor.
 
virtual ~PackedRawDataCnvSvc ()
 Standard Destructor.
 
virtual StatusCode initialize ()
 Initialize the service.
 
virtual StatusCode updateServiceState (IOpaqueAddress *pAddress)
 Update state of the service.
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 Override inherited queryInterface.
 
virtual StatusCode connectOutput (const std::string &t)
 
virtual StatusCode connectOutput (const std::string &t, const std::string &)
 
virtual StatusCode commitOutput (const std::string &t, bool b)
 
virtual WriteRawEvent *& getRawEvent ()
 
- Public Member Functions inherited from RawDataCnvSvc
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode declareObject (const IRawDataCnvSvc::Leaf &leaf)
 Associates a path on TDS with a particular converter.
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 Override inherited queryInterface due to enhanced interface.
 
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
 
virtual StatusCode createAddress (long storageType, const CLID &clid, const std::string &, IOpaqueAddress *&refpAddress)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode declareObject (const IRawDataCnvSvc::Leaf &leaf)
 Associates a path on TDS with a particular converter.
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 Override inherited queryInterface due to enhanced interface.
 
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
 
virtual StatusCode createAddress (long storageType, const CLID &clid, const std::string &, IOpaqueAddress *&refpAddress)
 
virtual StatusCode declareObject (const Leaf &leaf)=0
 Declare target leaf.
 
virtual StatusCode declareObject (const Leaf &leaf)=0
 Declare target leaf.
 

Protected Member Functions

virtual StatusCode addConverters ()
 Add converters to the service.
 
virtual StatusCode addConverters ()
 Add converters to the service.
 
- Protected Member Functions inherited from RawDataCnvSvc
virtual StatusCode addConverters ()=0
 
StatusCode updateServiceState (IOpaqueAddress *pAddress)
 Update state of the service.
 
 RawDataCnvSvc (const std::string &name, ISvcLocator *svc, long storageTyp)
 
virtual ~RawDataCnvSvc ()
 
virtual StatusCode addConverters ()=0
 
StatusCode updateServiceState (IOpaqueAddress *pAddress)
 
 RawDataCnvSvc (const std::string &name, ISvcLocator *svc, long storageTyp)
 
virtual ~RawDataCnvSvc ()
 

Friends

class CnvFactory< PackedRawDataCnvSvc >
 

Detailed Description

Constructor & Destructor Documentation

◆ PackedRawDataCnvSvc() [1/2]

PackedRawDataCnvSvc::PackedRawDataCnvSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Standard Constructor.

Standard constructor.

Definition at line 49 of file PackedRawDataCnvSvc.cxx.

51{
52 declareProperty("RawDataOutputSvc", m_ioSvcName);
53 declareProperty("Status", m_status=0xFFFFFFFF); //fucd
54}

◆ ~PackedRawDataCnvSvc() [1/2]

PackedRawDataCnvSvc::~PackedRawDataCnvSvc ( )
virtual

Standard Destructor.

Definition at line 57 of file PackedRawDataCnvSvc.cxx.

58{}

◆ PackedRawDataCnvSvc() [2/2]

PackedRawDataCnvSvc::PackedRawDataCnvSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Standard Constructor.

◆ ~PackedRawDataCnvSvc() [2/2]

virtual PackedRawDataCnvSvc::~PackedRawDataCnvSvc ( )
virtual

Standard Destructor.

Member Function Documentation

◆ addConverters() [1/2]

StatusCode PackedRawDataCnvSvc::addConverters ( )
protectedvirtual

Add converters to the service.

Implements RawDataCnvSvc.

Definition at line 88 of file PackedRawDataCnvSvc.cxx.

88 {
89 MsgStream log(messageService(), name());
90 //log << MSG::INFO << name() << " PackedRawDataCnvSvc::addConverters" << endreq;
91 declareObject(IRawDataCnvSvc::Leaf(EventModel::EventH, RawDataCnv::classID(), "PASS", 0));
92 //log << MSG::INFO << "EventModel::EventH " << RawDataCnv::classID() << endreq;
93 declareObject(IRawDataCnvSvc::Leaf(EventModel::EventHeader, RawDataEvtHeaderCnv::classID(), "PASS", 0));
94 //log << MSG::INFO << "EventModel::EventHeader " << RawDataEvtHeaderCnv::classID() << endreq;
112
113 return StatusCode::SUCCESS;
114}
virtual StatusCode declareObject(const IRawDataCnvSvc::Leaf &leaf)
Associates a path on TDS with a particular converter.
static const CLID & classID()
Definition: RawDataCnv.cxx:85
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()
static const CLID & classID()

◆ addConverters() [2/2]

virtual StatusCode PackedRawDataCnvSvc::addConverters ( )
protectedvirtual

Add converters to the service.

Implements RawDataCnvSvc.

◆ commitOutput() [1/2]

StatusCode PackedRawDataCnvSvc::commitOutput ( const std::string &  t,
bool  b 
)
virtual

Definition at line 166 of file PackedRawDataCnvSvc.cxx.

167{
168 MsgStream log(messageService(), name() );
169
170 log << MSG::DEBUG << "In flushOutput" << endreq;
171
172 if (!m_ioSvc) {
173 log << MSG::ERROR << "RawDataCnvSvc not configure for output" << endreq;
174 return StatusCode::FAILURE;
175 }
176
177 /*if (!m_rawEvent->is_valid()) {
178 log << MSG::ERROR << "commitOutput failed, because FullEventFragment invalid"
179 << m_rawEvent << endreq;
180 return StatusCode::FAILURE;
181 }*/
182
183 log << MSG::DEBUG << "commitOutput: Size of Event (words) ="
184 << m_rawEvent->size_word() << endreq;
185
186 if (!m_ioSvc->putEvent(m_rawEvent) ) {
187 log << MSG::ERROR << "commitOutput failed to send output" << endreq;
188 return StatusCode::FAILURE;
189 }
190
191 // delete ...
192 const eformat::write::SubDetectorFragment* sd = m_rawEvent->first_child();
193 while ( sd != 0) {
194 const eformat::write::ROSFragment* ros = sd->first_child();
195 while (ros != 0) {
196 const eformat::write::ROBFragment* rob = ros->first_child();
197 while (rob != 0) {
198 const eformat::write::ROBFragment* rob_tmp = rob;
199 rob = rob->next();
200 delete rob_tmp;
201 }
202 const eformat::write::ROSFragment* ros_tmp = ros;
203 ros = ros->next();
204 delete ros_tmp;
205 }
206 const eformat::write::SubDetectorFragment* sd_tmp = sd;
207 sd = sd->next();
208 delete sd_tmp;
209 }
210 delete m_rawEvent;
211
212 return StatusCode::SUCCESS;
213}
virtual bool putEvent(WriteRawEvent *re)=0

◆ commitOutput() [2/2]

virtual StatusCode PackedRawDataCnvSvc::commitOutput ( const std::string &  t,
bool  b 
)
virtual

◆ connectOutput() [1/4]

StatusCode PackedRawDataCnvSvc::connectOutput ( const std::string &  t)
virtual

Definition at line 135 of file PackedRawDataCnvSvc.cxx.

136{
137
138 MsgStream log(messageService(), name() );
139
140 log << MSG::DEBUG << " In connectOutput "<< endreq;
141
142 // Get DataObj from TDS
143 SmartDataPtr<Event::EventHeader> evt(dataProvider(), EventModel::EventHeader);
144 if (!evt) {
145 log << MSG::ERROR << "Did not retrieve event" << endreq;
146 return StatusCode::FAILURE;
147 }
148 unsigned int eventNo = evt->eventNumber();
149 unsigned int runNo = evt->runNumber();
150
151 m_rawEvent = new WriteRawEvent(0x790000, // source_id
152 eventNo, // global_id
153 runNo, // run_no
154 eventNo, // lel1_id
155 0, // lel1_type
156 0, // lel2_info
157 ef_info // ef_info
158 );
159 //const unsigned int status = 0; // place holder for status
160 if(m_status!=0xFFFFFFFF) m_rawEvent->status(1, &m_status);
161 else m_rawEvent->status(0, NULL); //fucd
162
163 return StatusCode::SUCCESS;
164}
int runNo
Definition: DQA_TO_DB.cxx:12
int eventNo
void status(uint32_t n, const uint32_t *status)

Referenced by connectOutput().

◆ connectOutput() [2/4]

virtual StatusCode PackedRawDataCnvSvc::connectOutput ( const std::string &  t)
virtual

◆ connectOutput() [3/4]

virtual StatusCode PackedRawDataCnvSvc::connectOutput ( const std::string &  t,
const std::string &   
)
inlinevirtual

Definition at line 41 of file Event/RawDataCnv/RawDataCnv-00-05-04/RawDataCnv/PackedRawDataCnvSvc.h.

42 {
43 return connectOutput(t) ;
44 }
TTree * t
Definition: binning.cxx:23
virtual StatusCode connectOutput(const std::string &t)

◆ connectOutput() [4/4]

virtual StatusCode PackedRawDataCnvSvc::connectOutput ( const std::string &  t,
const std::string &   
)
inlinevirtual

Definition at line 41 of file InstallArea/include/RawDataCnv/RawDataCnv/PackedRawDataCnvSvc.h.

42 {
43 return connectOutput(t) ;
44 }

◆ getRawEvent() [1/2]

◆ getRawEvent() [2/2]

virtual WriteRawEvent *& PackedRawDataCnvSvc::getRawEvent ( )
inlinevirtual

Definition at line 50 of file InstallArea/include/RawDataCnv/RawDataCnv/PackedRawDataCnvSvc.h.

50 {
51 return m_rawEvent;
52 }

◆ initialize() [1/2]

StatusCode PackedRawDataCnvSvc::initialize ( )
virtual

Initialize the service.

Reimplemented from RawDataCnvSvc.

Definition at line 61 of file PackedRawDataCnvSvc.cxx.

61 {
62 MsgStream log(messageService(), name());
63 log << MSG::INFO << name() << " PackedRawDataCnvSvc::initialize RawDataOutputSvc:" << m_ioSvcName<< endreq;
64
65 StatusCode sc = RawDataCnvSvc::initialize();
66 if( sc.isFailure() ) {
67 log << MSG::ERROR << "Unable to initialize service " << endreq;
68 return sc;
69 }
70
71 IService* svc ;
72 sc = service(m_ioSvcName, svc);
73 if (sc != StatusCode::SUCCESS ) {
74 log << MSG::WARNING << "Cant get RawDataOutputSvc " << endreq;
75 //return sc ;
76 }
77
78 m_ioSvc = dynamic_cast<IRawDataOutputSvc*> (svc);
79 if (m_ioSvc == 0 ) {
80 log << MSG::WARNING << "Cant cast to RawDataOutputSvc " << endreq;
81 //return StatusCode::FAILURE;
82 }
83
84 return StatusCode::SUCCESS;
85}
The event conversion service needs an additional interface used by the converters to declare their ob...
virtual StatusCode initialize()

◆ initialize() [2/2]

virtual StatusCode PackedRawDataCnvSvc::initialize ( )
virtual

Initialize the service.

Reimplemented from RawDataCnvSvc.

◆ queryInterface() [1/2]

StatusCode PackedRawDataCnvSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
virtual

Override inherited queryInterface.

Reimplemented from RawDataCnvSvc.

Definition at line 124 of file PackedRawDataCnvSvc.cxx.

124 {
125 if ( IID_IRawDataBaseCnv == riid ) {
126 *ppvInterface = (IRawDataCnvSvc*)this;
127 } else {
128 // Interface is not directly availible: try out a base class
129 return ConversionSvc::queryInterface(riid, ppvInterface);
130 }
131 addRef();
132 return StatusCode::SUCCESS;
133}

◆ queryInterface() [2/2]

virtual StatusCode PackedRawDataCnvSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
virtual

Override inherited queryInterface.

Reimplemented from RawDataCnvSvc.

◆ updateServiceState() [1/2]

StatusCode PackedRawDataCnvSvc::updateServiceState ( IOpaqueAddress *  pAddress)
virtual

Update state of the service.

Definition at line 117 of file PackedRawDataCnvSvc.cxx.

117 {
118 MsgStream log(messageService(), name());
119 StatusCode sc = RawDataCnvSvc::updateServiceState(pAddress);
120 //log << MSG::INFO << "In PackedRawDataCnvSvc::updateServiceState" << endreq;
121 return sc;
122}
StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.

◆ updateServiceState() [2/2]

virtual StatusCode PackedRawDataCnvSvc::updateServiceState ( IOpaqueAddress *  pAddress)
virtual

Update state of the service.

Friends And Related Function Documentation

◆ CnvFactory< PackedRawDataCnvSvc >


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