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

In This Package:

XmlUserConditionCnv.h

Go to the documentation of this file.
00001 // $ID: $
00002 
00003 #ifndef DETDESCCNV_XMLUSERCONDITIONCNV_H
00004 #define DETDESCCNV_XMLUSERCONDITIONCNV_H 1
00005 
00006 // Include files
00007 #include "DetDescCnv/XmlBaseConditionCnv.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 XmlUserConditionCnv : public XmlBaseConditionCnv {
00029   
00031   typedef XmlUserConditionCnv<DeType> MyType;
00033   friend class CnvFactory<MyType>;
00034   
00035 
00036  public:
00037 
00042   XmlUserConditionCnv (ISvcLocator* svc);
00043   
00047   virtual ~XmlUserConditionCnv() {};
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                                         Condition* 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 // Constructor
00108 // ------------------------------------------------------------------------
00109 template <class DeType>
00110 XmlUserConditionCnv<DeType>::XmlUserConditionCnv (ISvcLocator* svc)
00111   : XmlBaseConditionCnv (svc, DeType::classID()) {
00112 } // end constructor
00113 
00114 
00115 // -----------------------------------------------------------------------
00116 // Create an object corresponding to a DOM element
00117 // -----------------------------------------------------------------------
00118 template <class DeType>
00119 StatusCode
00120 XmlUserConditionCnv<DeType>::i_createObj(xercesc::DOMElement* /*element*/,
00121                                          DataObject*& refpObject) {
00122   MsgStream log(msgSvc(), "XmlUserConditionCnv" );
00123   log << MSG::DEBUG << "entering i_createObj" << endreq;
00124   
00125   // creates an object for the node found
00126   refpObject = new DeType();
00127   
00128   // returns
00129   return StatusCode::SUCCESS;
00130 } // end i_createObj
00131 
00132 
00133 // -----------------------------------------------------------------------
00134 // Fill an object with a new specific child element
00135 // ------------------------------------------------------------------------
00136 template <class DeType>
00137 StatusCode
00138 XmlUserConditionCnv<DeType>::i_fillSpecificObj
00139 (xercesc::DOMElement* childElement,
00140  Condition* 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 XmlUserConditionCnv<DeType>::i_fillSpecificObj
00152 (xercesc::DOMElement* childElement,
00153  DeType* dataObj,
00154  IOpaqueAddress* /*address*/) {
00155   return i_fillSpecificObj (childElement, dataObj);
00156 }
00157 
00158 // -----------------------------------------------------------------------
00159 // Fill an object with a new specific child element
00160 // ------------------------------------------------------------------------
00161 template <class DeType>
00162 StatusCode
00163 XmlUserConditionCnv<DeType>::i_fillSpecificObj
00164 (xercesc::DOMElement* /*childElement*/,
00165  DeType* /*dataObj*/) {
00166   return StatusCode::SUCCESS;
00167 }
00168 
00169 #endif // DETDESCCNV_XMLUSERCONDITIONCNV_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