#include <CalibXmlCnvSvc.h>
Inheritance diagram for CalibXmlCnvSvc:
Public Member Functions | |
virtual StatusCode | createAddress (unsigned char svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) |
virtual StatusCode | createAddress (unsigned char svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) |
virtual StatusCode | finalize () |
virtual StatusCode | finalize () |
virtual StatusCode | initialize () |
virtual StatusCode | initialize () |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | parse (const char *filename) |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | parse (const char *filename) |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
Static Public Member Functions | |
const InterfaceID & | interfaceID () |
const InterfaceID & | interfaceID () |
Protected Member Functions | |
CalibXmlCnvSvc (const std::string &name, ISvcLocator *svc) | |
CalibXmlCnvSvc (const std::string &name, ISvcLocator *svc) | |
virtual | ~CalibXmlCnvSvc () |
virtual | ~CalibXmlCnvSvc () |
Private Attributes | |
IDetDataSvc * | m_detDataSvc |
Handle to the IDetDataSvc interface of the CalibDataSvc. | |
IDetDataSvc * | m_detDataSvc |
Handle to the IDetDataSvc interface of the CalibDataSvc. | |
IConversionSvc * | m_detPersSvc |
Handle to the IConversionSvc interface of the DetectorPersistencySvc. | |
IConversionSvc * | m_detPersSvc |
Handle to the IConversionSvc interface of the DetectorPersistencySvc. | |
xmlBase::XmlParser * | m_parser |
xmlBase::XmlParser * | m_parser |
Friends | |
class | SvcFactory<CalibXmlCnvSvc> |
Only factories can access protected constructors. |
A conversion service for GLAST calibration bulk data in Xml format.
|
00024 : 00025 ConversionSvc(name, svc, XML_StorageType), 00026 m_detPersSvc(0), m_detDataSvc(0), m_parser(0) { 00027 00028 // Some day might have a property to declare having to do with path to 00029 // xml files. 00030 }
|
|
00039 {}
|
|
|
|
00039 {}
|
|
Create an XML address using explicit arguments to identify a single object
|
|
Create an XML address using explicit arguments to identify a single object
00136 { 00137 00138 MsgStream log( msgSvc(), name() ); 00139 00140 if (svc_type != XML_StorageType) { 00141 log << MSG::ERROR << "bad storage type" << (int)svc_type << endreq; 00142 return StatusCode::FAILURE; 00143 } 00144 00145 std::string dataIdent(par[0]); // file identifier for PDS version of data 00146 std::string fullpath(par[1]); // path within TCDS for the object 00147 std::string fmtVersion(par[2]); 00148 int serNo = ip[0]; 00149 00150 // for now have to ignore fmtVersion because of defective implementation 00151 // of GenericAddress. If we want it, should probably write new 00152 // opaque address implementation for this package to use. All 00153 // dealings with (calibration) opaque addresses are confined to 00154 // the CalibSvc package. 00155 refpAddress = new GenericAddress(XML_StorageType, 00156 clid, 00157 dataIdent, 00158 fullpath, 00159 serNo); 00160 00161 return StatusCode::SUCCESS; 00162 00163 }
|
|
|
|
00126 { 00127 delete m_parser; 00128 m_parser = 0; 00129 return ConversionSvc::finalize(); 00130 }
|
|
|
|
00045 { 00046 StatusCode sc = ConversionSvc::initialize(); 00047 00048 MsgStream log(msgSvc(), "CalibXmlCnvSvc"); 00049 00050 if (!sc.isSuccess()) return sc; 00051 00052 /* Paste in a bit of CalibMySQLCnvSvc::initialize */ 00053 00054 // Locate the Calib Data Service. Since it inherits from DataSvc 00055 // it has to implement IDataProviderSvc 00056 IDataProviderSvc* pCDS = 0; 00057 sc = serviceLocator()->getService 00058 ("CalibDataSvc", IID_IDataProviderSvc, (IInterface*&)pCDS); 00059 if ( !sc.isSuccess() ) { 00060 log << MSG::ERROR << "Could not locate CalibDataSvc" << endreq; 00061 return sc; 00062 } 00063 00064 // Set the CalibDataSvc as data provider service 00065 sc = setDataProvider(pCDS); 00066 if ( !sc.isSuccess() ) { 00067 log << MSG::ERROR << "Could not set data provider" << endreq; 00068 return sc; 00069 } 00070 00071 /* End of pasted bit */ 00072 00073 00074 /* Paste in more of CalibMySQLCnvSvc::initialize */ 00075 // Locate IConversionSvc interface of the DetectorPersistencySvc 00076 sc = serviceLocator()->service 00077 ("DetectorPersistencySvc", m_detPersSvc, true); 00078 if ( !sc.isSuccess() ) { 00079 log << MSG::ERROR 00080 << "Cannot locate IConversionSvc interface of DetectorPersistencySvc" 00081 << endreq; 00082 return sc; 00083 } else { 00084 log << MSG::DEBUG 00085 << "Retrieved IConversionSvc interface of DetectorPersistencySvc" 00086 << endreq; 00087 } 00088 00089 // Query the IAddressCreator interface of the detector persistency service 00090 IAddressCreator* iAddrCreator; 00091 sc = m_detPersSvc->queryInterface(IID_IAddressCreator, 00092 (void**) &iAddrCreator); 00093 if ( !sc.isSuccess() ) { 00094 log << MSG::ERROR 00095 << "Cannot query IAddressCreator interface of DetectorPersistencySvc" 00096 << endreq; 00097 return sc; 00098 } else { 00099 log << MSG::DEBUG 00100 << "Retrieved IAddressCreator interface of DetectorPersistencySvc" 00101 << endreq; 00102 } 00103 log << MSG::DEBUG 00104 << "Set it as the address creator of the CalibXmlCnvSvc" << endreq; 00105 sc = setAddressCreator(iAddrCreator); 00106 if ( !sc.isSuccess() ) { 00107 log << MSG::ERROR << "Cannot set the address creator" << endreq; 00108 return sc; 00109 } 00110 00111 // end of second pasted piece 00112 00113 00114 m_parser = new xmlBase::XmlParser(); 00115 00116 if (m_parser == 0) { 00117 log << MSG::FATAL << "Unable to create XML parser instance \n" 00118 << endreq; 00119 } 00120 00121 // set properties if there are any?? 00122 00123 return sc; 00124 }
|
|
00030 { return IID_ICalibXmlSvc; }
|
|
00030 { return IID_ICalibXmlSvc; }
|
|
This method parses an xml file and produces the corresponding DOM document.
Implements ICalibXmlSvc. |
|
This method parses an xml file and produces the corresponding DOM document.
Implements ICalibXmlSvc.
|
|
|
|
00033 { 00034 if (IID_ICalibXmlSvc.versionMatch(riid)) { 00035 *ppvInterface = (ICalibXmlSvc*)this; 00036 } 00037 else { 00038 // Interface is not directly availible: try out a base class 00039 return ConversionSvc::queryInterface(riid, ppvInterface); 00040 } 00041 addRef(); 00042 return StatusCode::SUCCESS; 00043 }
|
|
Only factories can access protected constructors.
|
|
Handle to the IDetDataSvc interface of the CalibDataSvc.
|
|
Handle to the IDetDataSvc interface of the CalibDataSvc.
|
|
Handle to the IConversionSvc interface of the DetectorPersistencySvc.
|
|
Handle to the IConversionSvc interface of the DetectorPersistencySvc.
|
|
|
|
|