BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataBaseCnv.cxx
Go to the documentation of this file.
1#include "GaudiKernel/IService.h"
2#include "GaudiKernel/ISvcLocator.h"
3#include "GaudiKernel/MsgStream.h"
6#include <iostream>
7
8static const InterfaceID IID_IRawDataBaseCnv("IRawDataBaseCnv", 1 , 0);
9
10RawDataBaseCnv::RawDataBaseCnv(unsigned char storageType, const CLID& clid, ISvcLocator* svc)
11 : Converter((long)storageType, clid, svc), m_CnvSvc(0)
12{}
13
14
16: Converter(Test_StorageType, classID(), svc)
17 , m_CnvSvc(0)
18{}
19
20
21StatusCode RawDataBaseCnv::createRep(DataObject* ,
22 IOpaqueAddress*& ) {
23 // Purpose and Method: Convert the transient object to the requested
24 // representation. It is expected that derived classes will override
25 // this method.
26 return StatusCode::SUCCESS;
27}
28
29StatusCode RawDataBaseCnv::fillRepRefs(IOpaqueAddress* ,
30 DataObject* ) {
31 // Purpose and Method: Resolve the references of the converted object.
32 // It is expected that derived classes will override this method.
33 return StatusCode::SUCCESS;
34}
35
36StatusCode RawDataBaseCnv::updateRep(IOpaqueAddress* ,
37 DataObject* ) {
38 // Purpose and Method: Update the converted representation of a transient
39 // object. It is expected that derived classes will override this.
40 return StatusCode::SUCCESS;
41}
42
43StatusCode RawDataBaseCnv::updateRepRefs(IOpaqueAddress* ,
44 DataObject* ) {
45 // Purpose and Method: Update the references of an already converted object.
46 // It is expected that derived classes will override this method.
47 return StatusCode::SUCCESS;
48}
49
51 // Purpose and Method: Perform standard converter initialization.
52 // Access the EventCnvSvc to create an association between converters
53 // and paths within the TDS, using the vector of leaves and the
54 // declareObject methods available in each specific converter.
55 StatusCode status = Converter::initialize();
56 /*
57 if ( status.isSuccess() ) {
58 IService* isvc = 0;
59 status = serviceLocator()->service(cnvSvcName, isvc, true);
60 if ( status.isSuccess() ) {
61 status = isvc->queryInterface(IID_IRawDataBaseCnv, (void**)&m_CnvSvc);
62 if ( status.isSuccess() ) {
63 for ( std::vector<IRawDataCnvSvc::Leaf>::iterator i = m_leaves.begin(); i != m_leaves.end(); i++ ) {
64 m_CnvSvc->declareObject(*i);
65 }
66 }
67 }
68 }
69 */
70 return status;
71}
72
74 if ( m_CnvSvc ) {
75 m_CnvSvc->release();
76 m_CnvSvc = 0;
77 }
78 return Converter::finalize();
79}
80
81void RawDataBaseCnv::declareObject(const std::string& /*path*/, const CLID& /*cl*/,
82 const std::string& /*bank*/, long /*par*/) {
83 // Purpose and Method: Save the path on the TDS, in the m_leaves vector,
84 // corresponding to the DataObject that the converter handles.
85 // m_leaves.push_back(IRawDataCnvSvc::Leaf(path, cl, bank, par));
86}
87
88
89
virtual StatusCode finalize()
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
RawDataBaseCnv(ISvcLocator *svc)
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.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Resolve the references of the converted object.
StatusCode initialize()
IRawDataCnvSvc * m_CnvSvc
Pointer to event conversion service interface.
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.