Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CalibXmlCnvSvc Class Reference

--------------------------------------------------------------------------- More...

#include <CalibXmlCnvSvc.h>

Inheritance diagram for CalibXmlCnvSvc:

ICalibXmlSvc ICalibXmlSvc List of all members.

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::XmlParserm_parser
xmlBase::XmlParserm_parser

Friends

class SvcFactory<CalibXmlCnvSvc>
 Only factories can access protected constructors.

Detailed Description

---------------------------------------------------------------------------

A conversion service for GLAST calibration bulk data in Xml format.

Author:
J. Bogart
Date:
November 2002


Constructor & Destructor Documentation

CalibXmlCnvSvc::CalibXmlCnvSvc const std::string &  name,
ISvcLocator *  svc
[protected]
 

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 }

virtual CalibXmlCnvSvc::~CalibXmlCnvSvc  )  [inline, protected, virtual]
 

00039 {}

CalibXmlCnvSvc::CalibXmlCnvSvc const std::string &  name,
ISvcLocator *  svc
[protected]
 

virtual CalibXmlCnvSvc::~CalibXmlCnvSvc  )  [inline, protected, virtual]
 

00039 {}


Member Function Documentation

virtual StatusCode CalibXmlCnvSvc::createAddress unsigned char  svc_type,
const CLID &  clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress
[virtual]
 

Create an XML address using explicit arguments to identify a single object

Parameters:
svc_type the service type
CLID the CLID of the XML Element for which an address is created
par an array of three strings containing the format version, calibration type name and the flavor, in this order
ip has a single element, the serial number of the MySQL row which corresponds to this element
refpAddress the new address created
Returns:
a StatusCode giving the status of the address creation

StatusCode CalibXmlCnvSvc::createAddress unsigned char  svc_type,
const CLID &  clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress
[virtual]
 

Create an XML address using explicit arguments to identify a single object

Parameters:
svc_type the service type
CLID the CLID of the XML Element for which an address is created
par an array of three strings containing the format version, calibration type name and the flavor, in this order
ip has a single element, the serial number of the MySQL row which corresponds to this element
refpAddress the new address created
Returns:
a StatusCode giving the status of the address creation
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 }

virtual StatusCode CalibXmlCnvSvc::finalize  )  [virtual]
 

StatusCode CalibXmlCnvSvc::finalize  )  [virtual]
 

00126                                     {
00127   delete m_parser;
00128   m_parser = 0;
00129   return ConversionSvc::finalize();
00130 }

virtual StatusCode CalibXmlCnvSvc::initialize  )  [virtual]
 

StatusCode CalibXmlCnvSvc::initialize  )  [virtual]
 

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 }

const InterfaceID& ICalibXmlSvc::interfaceID  )  [inline, static, inherited]
 

00030 { return IID_ICalibXmlSvc; }

const InterfaceID& ICalibXmlSvc::interfaceID  )  [inline, static, inherited]
 

00030 { return IID_ICalibXmlSvc; }

virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* CalibXmlCnvSvc::parse const char *  filename  )  [virtual]
 

This method parses an xml file and produces the corresponding DOM document.

Parameters:
fileName the name of the file to parse
Returns:
the document issued from the parsing

Implements ICalibXmlSvc.

XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * CalibXmlCnvSvc::parse const char *  filename  )  [virtual]
 

This method parses an xml file and produces the corresponding DOM document.

Parameters:
fileName the name of the file to parse
Returns:
the document issued from the parsing

Implements ICalibXmlSvc.

00169                                           {
00170   return m_parser->parse(filename);
00171 }

virtual StatusCode CalibXmlCnvSvc::queryInterface const InterfaceID &  riid,
void **  ppvInterface
[virtual]
 

StatusCode CalibXmlCnvSvc::queryInterface const InterfaceID &  riid,
void **  ppvInterface
[virtual]
 

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 }


Friends And Related Function Documentation

SvcFactory<CalibXmlCnvSvc> [friend]
 

Only factories can access protected constructors.


Member Data Documentation

IDetDataSvc* CalibXmlCnvSvc::m_detDataSvc [private]
 

Handle to the IDetDataSvc interface of the CalibDataSvc.

IDetDataSvc* CalibXmlCnvSvc::m_detDataSvc [private]
 

Handle to the IDetDataSvc interface of the CalibDataSvc.

IConversionSvc* CalibXmlCnvSvc::m_detPersSvc [private]
 

Handle to the IConversionSvc interface of the DetectorPersistencySvc.

IConversionSvc* CalibXmlCnvSvc::m_detPersSvc [private]
 

Handle to the IConversionSvc interface of the DetectorPersistencySvc.

xmlBase::XmlParser* CalibXmlCnvSvc::m_parser [private]
 

xmlBase::XmlParser* CalibXmlCnvSvc::m_parser [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 15:55:56 2011 for BOSS6.5.5 by  doxygen 1.3.9.1