00001
00002
00003 #ifndef DETDESCCNV_XMLUSERCONDITIONCNV_H
00004 #define DETDESCCNV_XMLUSERCONDITIONCNV_H 1
00005
00006
00007 #include "DetDescCnv/XmlBaseConditionCnv.h"
00008 #include "GaudiKernel/MsgStream.h"
00009
00010
00011
00012
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
00108
00109 template <class DeType>
00110 XmlUserConditionCnv<DeType>::XmlUserConditionCnv (ISvcLocator* svc)
00111 : XmlBaseConditionCnv (svc, DeType::classID()) {
00112 }
00113
00114
00115
00116
00117
00118 template <class DeType>
00119 StatusCode
00120 XmlUserConditionCnv<DeType>::i_createObj(xercesc::DOMElement* ,
00121 DataObject*& refpObject) {
00122 MsgStream log(msgSvc(), "XmlUserConditionCnv" );
00123 log << MSG::DEBUG << "entering i_createObj" << endreq;
00124
00125
00126 refpObject = new DeType();
00127
00128
00129 return StatusCode::SUCCESS;
00130 }
00131
00132
00133
00134
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
00148
00149 template <class DeType>
00150 StatusCode
00151 XmlUserConditionCnv<DeType>::i_fillSpecificObj
00152 (xercesc::DOMElement* childElement,
00153 DeType* dataObj,
00154 IOpaqueAddress* ) {
00155 return i_fillSpecificObj (childElement, dataObj);
00156 }
00157
00158
00159
00160
00161 template <class DeType>
00162 StatusCode
00163 XmlUserConditionCnv<DeType>::i_fillSpecificObj
00164 (xercesc::DOMElement* ,
00165 DeType* ) {
00166 return StatusCode::SUCCESS;
00167 }
00168
00169 #endif // DETDESCCNV_XMLUSERCONDITIONCNV_H