| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

XmlUserDetElemCnv.h

Go to the documentation of this file.
00001 // $ID: $
00002 
00003 #ifndef DETDESCCNV_XMLUSERDETELEMCNV_H
00004 #define DETDESCCNV_XMLUSERDETELEMCNV_H 1
00005 
00006 // Include files
00007 #include "DetDescCnv/XmlBaseDetElemCnv.h"
00008 #include "GaudiKernel/MsgStream.h"
00009 
00010 // These two includes are not needed here but are needed inside children
00011 // of this class. In order to avoid the user to forget to include them,
00012 // we put it here
00013 #include "GaudiKernel/CnvFactory.h"
00014 #include "XmlTools/IXmlSvc.h"
00015 
00016 
00028 template <class DeType> class XmlUserDetElemCnv : public XmlBaseDetElemCnv {
00029   
00031   typedef XmlUserDetElemCnv<DeType> MyType;
00033   friend class CnvFactory<MyType>;
00034   
00035 
00036  public:
00037 
00042   XmlUserDetElemCnv (ISvcLocator* svc);
00043   
00047   virtual ~XmlUserDetElemCnv() {};
00048   
00053   static const CLID& classID() { return DeType::classID(); }
00054 
00055 
00056  protected:
00057 
00064   virtual StatusCode i_createObj (xercesc::DOMElement* element,
00065                                   DataObject*& refpObject);  
00066 
00076   virtual StatusCode i_fillSpecificObj (xercesc::DOMElement* childElement,
00077                                         DetectorElement* refpObject,
00078                                         IOpaqueAddress* address);
00079 
00089   virtual StatusCode i_fillSpecificObj (xercesc::DOMElement* childElement,
00090                                         DeType* dataObj,
00091                                         IOpaqueAddress* address);
00092 
00101   virtual StatusCode i_fillSpecificObj (xercesc::DOMElement* childElement,
00102                                         DeType* dataObj);
00103 
00104 };
00105 
00106 
00107 // -----------------------------------------------------------------------
00108 // Constructor
00109 // ------------------------------------------------------------------------
00110 template <class DeType>
00111 XmlUserDetElemCnv<DeType>::XmlUserDetElemCnv (ISvcLocator* svc)
00112   : XmlBaseDetElemCnv (svc, DeType::classID()) {
00113 } // end constructor
00114 
00115 
00116 // -----------------------------------------------------------------------
00117 // Create an object corresponding to a DOM element
00118 // -----------------------------------------------------------------------
00119 template <class DeType>
00120 StatusCode
00121 XmlUserDetElemCnv<DeType>::i_createObj(xercesc::DOMElement* /*element*/,
00122                                        DataObject*& refpObject) {
00123   MsgStream log(msgSvc(), "XmlUserDetElemCnv" );
00124   log << MSG::DEBUG << "entering i_createObj" << endreq;
00125   
00126   // creates an object for the node found
00127   refpObject = new DeType();
00128   
00129   // returns
00130   return StatusCode::SUCCESS;
00131 } // end i_createObj
00132 
00133 
00134 // -----------------------------------------------------------------------
00135 // Fill an object with a new specific child element
00136 // ------------------------------------------------------------------------
00137 template <class DeType>
00138 StatusCode
00139 XmlUserDetElemCnv<DeType>::i_fillSpecificObj (xercesc::DOMElement* childElement,
00140                                               DetectorElement* refpObject,
00141                                               IOpaqueAddress* address) {
00142   DeType* dataObj = dynamic_cast<DeType*> (refpObject);
00143   return i_fillSpecificObj (childElement, dataObj, address);
00144 }
00145 
00146 // -----------------------------------------------------------------------
00147 // Fill an object with a new specific child element
00148 // ------------------------------------------------------------------------
00149 template <class DeType>
00150 StatusCode
00151 XmlUserDetElemCnv<DeType>::i_fillSpecificObj (xercesc::DOMElement* childElement,
00152                                               DeType* dataObj,
00153                                               IOpaqueAddress* /*address*/) {
00154   return i_fillSpecificObj (childElement, dataObj);
00155 }
00156 
00157 // -----------------------------------------------------------------------
00158 // Fill an object with a new specific child element
00159 // ------------------------------------------------------------------------
00160 template <class DeType>
00161 StatusCode
00162 XmlUserDetElemCnv<DeType>::i_fillSpecificObj
00163 (xercesc::DOMElement* /*childElement*/,
00164  DeType* /*dataObj*/) {
00165   return StatusCode::SUCCESS;
00166 }
00167 
00168 #endif // DETDESCCNV_XMLUSERDETELEMCNV_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:00:54 2011 for DetDescCnv by doxygen 1.4.7