#include <XmlBaseConditionCnv.h>
Inheritance diagram for XmlBaseConditionCnv:
Public Types | |
| INVALID_ADDRESS | |
| INVALID_OBJECT | |
| NO_MEMORY | |
| BAD_STORAGE_TYPE | |
| NO_SOURCE_OBJECT | |
| ICONVERSIONSVC_LAST_ERROR | |
| SUCCESS | |
| NO_INTERFACE | |
| VERSMISMATCH | |
| LAST_ERROR | |
| enum | Status |
Public Member Functions | |
| virtual StatusCode | initialize () |
| Initializes the converter - Overrides the default method in XmlGenericCnv. | |
| virtual StatusCode | finalize () |
| Finalizes the converter. | |
| virtual StatusCode | createObj (IOpaqueAddress *addr, DataObject *&refpObject) |
| Creates the transient representation of an object. | |
| virtual StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *pObject) |
| Updates the transient object from the other representation. | |
| virtual StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) |
| Converts the transient object to the requested representation. | |
| virtual StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject) |
| Updates the converted representation of a transient object. | |
| IXmlSvc * | xmlSvc () |
| Accessor to the IXmlSvc interface of the XmlCnvSvc service. | |
| virtual long | repSvcType () const |
| Accessor to the StorageType value. | |
| virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
| virtual unsigned long | addRef () |
| virtual unsigned long | release () |
| virtual StatusCode | setDataProvider (IDataProviderSvc *svc) |
| virtual IDataProviderSvc * | dataProvider () const |
| virtual StatusCode | setConversionSvc (IConversionSvc *svc) |
| virtual IConversionSvc * | conversionSvc () const |
| virtual StatusCode | setAddressCreator (IAddressCreator *creator) |
| virtual IAddressCreator * | addressCreator () const |
| virtual const CLID & | objType () const |
| virtual long | i_repSvcType () const |
| virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| virtual StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| StatusCode | service (const std::string &name, T *&psvc, bool createIf=false) const |
| StatusCode | service (const std::string &type, const std::string &name, T *&psvc) const |
Static Public Member Functions | |
| static const CLID & | classID () |
| accessor to the type of elements that this converter converts | |
| static long | storageType () |
| Accessor to the StorageType value. | |
| static const InterfaceID & | interfaceID () |
Public Attributes | |
| INVALID_ADDRESS | |
| INVALID_OBJECT | |
| NO_MEMORY | |
| BAD_STORAGE_TYPE | |
| NO_SOURCE_OBJECT | |
| ICONVERSIONSVC_LAST_ERROR | |
Protected Member Functions | |
| XmlBaseConditionCnv (ISvcLocator *svcs) | |
| Constructor for this converter. | |
| XmlBaseConditionCnv (ISvcLocator *svc, const CLID &clsID) | |
| Constructor for this converter. | |
| virtual | ~XmlBaseConditionCnv () |
| Default destructor. | |
| virtual StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| Resolves the references of the created transient object. | |
| virtual StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| Resolves the references of the just updated transient object. | |
| virtual StatusCode | i_createObj (xercesc::DOMElement *element, DataObject *&refpObject) |
| Creates the transient representation of an object from a DOMElement. | |
| virtual StatusCode | i_fillObj (xercesc::DOMElement *childElement, DataObject *refpObject, IOpaqueAddress *address) |
| Fills the current object for its child element childElement. | |
| virtual StatusCode | i_fillSpecificObj (xercesc::DOMElement *childElement, Condition *refpObject, IOpaqueAddress *address)=0 |
| This fills the current object for specific child. | |
| virtual StatusCode | internalCreateObj (xercesc::DOMElement *element, DataObject *&refpObject, IOpaqueAddress *address) |
| This creates the transient representation of an object from the DOMElement representing it, then fills it and process it. | |
| virtual StatusCode | i_fillObj (xercesc::DOMText *childText, DataObject *pObject, IOpaqueAddress *address) |
| This fills the current object for its child text node childText. | |
| virtual StatusCode | i_processObj (DataObject *pObject, IOpaqueAddress *address) |
| This is called after the current object was filled. | |
| IOpaqueAddress * | createAddressForHref (std::string href, CLID clid, IOpaqueAddress *parent) const |
| This parses a href attribute string and creates an address out of it Currently, two types of references are understood : regular URLs and references starting with "conddb:/". | |
| IOpaqueAddress * | createXmlAddress (std::string location, std::string entryName, CLID clid) const |
| This creates an XmlAddress using the location, entryName and clid. | |
| IOpaqueAddress * | createCondDBAddress (std::string path, std::string entryName, unsigned long channelId, CLID clid) const |
| This creates a ConddbAddress using the location, entryName, channelID and clid. | |
| ISvcLocator * | serviceLocator () const |
| IMessageSvc * | msgSvc () const |
| IMessageSvc * | messageService () const |
| IDataManagerSvc * | dataManager () const |
Static Protected Member Functions | |
| static const std::string | dom2Std (const XMLCh *domString) |
| builds a standard string from a XMLCh* | |
Protected Attributes | |
| IXmlSvc * | m_xmlSvc |
| the IXmlSvc interface of this object | |
Private Member Functions | |
| template<class T> | |
| T | i_convert (const XMLCh *value) |
| template<class T> | |
| T | i_convert (const std::string &value) |
| template<class T> | |
| T | i_convertVect (XMLCh *value) |
| template<class K, class V> | |
| std::map< K, V > | i_makeMap (xercesc::DOMNodeList *entries) |
Private Attributes | |
| bool | m_doGenericCnv |
| Whether to use the generic converter in case a specific one does not exist. | |
| const XMLCh * | specificString |
| const XMLCh * | paramString |
| const XMLCh * | paramVectorString |
| const XMLCh * | mapString |
| const XMLCh * | itemString |
| const XMLCh * | typeString |
| const XMLCh * | nameString |
| const XMLCh * | commentString |
| const XMLCh * | keytypeString |
| const XMLCh * | valuetypeString |
| const XMLCh * | keyString |
| const XMLCh * | valueString |
Definition at line 25 of file XmlBaseConditionCnv.h.
| XmlBaseConditionCnv::XmlBaseConditionCnv | ( | ISvcLocator * | svcs | ) | [protected] |
| XmlBaseConditionCnv::XmlBaseConditionCnv | ( | ISvcLocator * | svc, | |
| const CLID & | clsID | |||
| ) | [protected] |
Constructor for this converter.
| svc | a ISvcLocator interface to find services | |
| clsID | the type of object the converter is able to convert |
| virtual XmlBaseConditionCnv::~XmlBaseConditionCnv | ( | ) | [protected, virtual] |
Default destructor.
| virtual StatusCode XmlBaseConditionCnv::initialize | ( | ) | [virtual] |
Initializes the converter - Overrides the default method in XmlGenericCnv.
Reimplemented from XmlGenericCnv.
| static const CLID& XmlBaseConditionCnv::classID | ( | ) | [static] |
accessor to the type of elements that this converter converts
Reimplemented in XmlUserConditionCnv< DeType >.
| virtual StatusCode XmlBaseConditionCnv::fillObjRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [protected, virtual] |
| virtual StatusCode XmlBaseConditionCnv::updateObjRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [protected, virtual] |
| virtual StatusCode XmlBaseConditionCnv::i_createObj | ( | xercesc::DOMElement * | element, | |
| DataObject *& | refpObject | |||
| ) | [protected, virtual] |
Creates the transient representation of an object from a DOMElement.
Overrides the default method in XmlGenericCnv
| element | the DOMElement to be used to builds the object | |
| refpObject | the object to be built |
Reimplemented from XmlGenericCnv.
Reimplemented in XmlUserConditionCnv< DeType >.
| virtual StatusCode XmlBaseConditionCnv::i_fillObj | ( | xercesc::DOMElement * | childElement, | |
| DataObject * | refpObject, | |||
| IOpaqueAddress * | address | |||
| ) | [protected, virtual] |
Fills the current object for its child element childElement.
Overrides the default method in XmlGenericCnv
| childElement | the child processed here | |
| refpObject | the object to be filled | |
| address | the address for this object |
Reimplemented from XmlGenericCnv.
| virtual StatusCode XmlBaseConditionCnv::i_fillSpecificObj | ( | xercesc::DOMElement * | childElement, | |
| Condition * | refpObject, | |||
| IOpaqueAddress * | address | |||
| ) | [protected, pure virtual] |
This fills the current object for specific child.
Specific children are children of children <specific> of the <condition> tag. This is typically used for specializing consditions and define new properties. This will be called for each specific child of the current object
| childElement | the specific child processed here | |
| refpObject | the object to be filled | |
| address | the address for this object |
Implemented in XmlUserConditionCnv< DeType >.
| T XmlBaseConditionCnv::i_convert | ( | const XMLCh * | value | ) | [inline, private] |
| T XmlBaseConditionCnv::i_convert | ( | const std::string & | value | ) | [inline, private] |
| T XmlBaseConditionCnv::i_convertVect | ( | XMLCh * | value | ) | [inline, private] |
Definition at line 140 of file XmlBaseConditionCnv.h.
00140 { 00141 std::vector<T> v; 00142 std::istringstream cstr(i_convert<std::string>(value)); 00143 std::string itemval; 00144 while (cstr >> itemval) { 00145 v.push_back(i_convert<T>(itemval)); 00146 } 00147 return v; 00148 }
| std::map<K,V> XmlBaseConditionCnv::i_makeMap | ( | xercesc::DOMNodeList * | entries | ) | [inline, private] |
Definition at line 151 of file XmlBaseConditionCnv.h.
00151 { 00152 std::map<K,V> map; 00153 XMLSize_t i; 00154 for (i = 0; i < entries->getLength(); i++) { 00155 xercesc::DOMNode* entryNode = entries->item(i); 00156 if (entryNode->getNodeType() == xercesc::DOMNode::ELEMENT_NODE) { 00157 xercesc::DOMElement* entry = static_cast<xercesc::DOMElement*>(entryNode); 00158 map[i_convert<K>(entry->getAttribute(keyString))] = 00159 i_convert<V>(entry->getAttribute(valueString)); 00160 } 00161 } 00162 return map; 00163 }
| virtual StatusCode XmlGenericCnv::finalize | ( | ) | [virtual, inherited] |
Finalizes the converter.
Reimplemented from Converter.
| virtual StatusCode XmlGenericCnv::createObj | ( | IOpaqueAddress * | addr, | |
| DataObject *& | refpObject | |||
| ) | [virtual, inherited] |
Creates the transient representation of an object.
| addr | the address of the object representation | |
| refpObject | the object created |
Reimplemented from Converter.
| virtual StatusCode XmlGenericCnv::updateObj | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [virtual, inherited] |
Updates the transient object from the other representation.
| pAddress | the address of the object representation | |
| pObject | the object updated |
Reimplemented from Converter.
| virtual StatusCode XmlGenericCnv::createRep | ( | DataObject * | pObject, | |
| IOpaqueAddress *& | refpAddress | |||
| ) | [virtual, inherited] |
Converts the transient object to the requested representation.
| refpAddress | the address of the object representation | |
| pObject | the object to convert |
Reimplemented from Converter.
| virtual StatusCode XmlGenericCnv::updateRep | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [virtual, inherited] |
Updates the converted representation of a transient object.
| pAddress | the address of the object representation | |
| pObject | the object whose representation has to be updated |
Reimplemented from Converter.
| IXmlSvc* XmlGenericCnv::xmlSvc | ( | ) | [inline, inherited] |
Accessor to the IXmlSvc interface of the XmlCnvSvc service.
status depending on the completion of the call
Definition at line 91 of file XmlGenericCnv.h.
00091 { 00092 if (!m_xmlSvc) m_xmlSvc = dynamic_cast<IXmlSvc*>(conversionSvc()); 00093 return m_xmlSvc; 00094 }
| static long XmlGenericCnv::storageType | ( | ) | [inline, static, inherited] |
Accessor to the StorageType value.
Definition at line 100 of file XmlGenericCnv.h.
00100 { 00101 return XML_StorageType; 00102 }
| virtual long XmlGenericCnv::repSvcType | ( | ) | const [inline, virtual, inherited] |
Accessor to the StorageType value.
Implements Converter.
Definition at line 108 of file XmlGenericCnv.h.
00108 { 00109 return XML_StorageType; 00110 }
| virtual StatusCode XmlGenericCnv::internalCreateObj | ( | xercesc::DOMElement * | element, | |
| DataObject *& | refpObject, | |||
| IOpaqueAddress * | address | |||
| ) | [protected, virtual, inherited] |
This creates the transient representation of an object from the DOMElement representing it, then fills it and process it.
This implementation actually only calls the i_* methods to do the job. Most of the converters don't need to override it but only to override/implement some of the i_* methods.
| element | the DOMElement to be used to builds the object | |
| refpObject | the object to be built | |
| address | the address for this object |
| virtual StatusCode XmlGenericCnv::i_fillObj | ( | xercesc::DOMText * | childText, | |
| DataObject * | pObject, | |||
| IOpaqueAddress * | address | |||
| ) | [protected, virtual, inherited] |
This fills the current object for its child text node childText.
This will be called for each text child of the current object
| childText | the child processed here | |
| pObject | the object to be filled | |
| address | the address for this object |
| virtual StatusCode XmlGenericCnv::i_processObj | ( | DataObject * | pObject, | |
| IOpaqueAddress * | address | |||
| ) | [protected, virtual, inherited] |
This is called after the current object was filled.
This is were some computation based on the object content could be done
| pObject | the object to be processed | |
| address | the address for this object |
| IOpaqueAddress* XmlGenericCnv::createAddressForHref | ( | std::string | href, | |
| CLID | clid, | |||
| IOpaqueAddress * | parent | |||
| ) | const [protected, inherited] |
This parses a href attribute string and creates an address out of it Currently, two types of references are understood : regular URLs and references starting with "conddb:/".
The former create addresses with storage type XML_StorageType, the later addresses with storage type CONDDB_StorageType.
| href | the string contained in the href attribute | |
| clid | the clid of the address to create | |
| parent | the address of the dataObject that will contain the new object. |
| IOpaqueAddress* XmlGenericCnv::createXmlAddress | ( | std::string | location, | |
| std::string | entryName, | |||
| CLID | clid | |||
| ) | const [protected, inherited] |
This creates an XmlAddress using the location, entryName and clid.
| location | the location string for this address | |
| entryName | the entryName string for this address | |
| clid | the clidof the address to create |
| IOpaqueAddress* XmlGenericCnv::createCondDBAddress | ( | std::string | path, | |
| std::string | entryName, | |||
| unsigned long | channelId, | |||
| CLID | clid | |||
| ) | const [protected, inherited] |
This creates a ConddbAddress using the location, entryName, channelID and clid.
| path | the path string for this address | |
| entryName | the entryName string for this address | |
| channelId | the channelID for this address | |
| clid | the clidof the address to create |
| static const std::string XmlGenericCnv::dom2Std | ( | const XMLCh * | domString | ) | [static, protected, inherited] |
builds a standard string from a XMLCh*
| domString | the XMLCh* |
bool XmlBaseConditionCnv::m_doGenericCnv [private] |
Whether to use the generic converter in case a specific one does not exist.
Definition at line 110 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::specificString [private] |
Definition at line 113 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::paramString [private] |
Definition at line 114 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::paramVectorString [private] |
Definition at line 115 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::mapString [private] |
Definition at line 116 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::itemString [private] |
Definition at line 117 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::typeString [private] |
Definition at line 120 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::nameString [private] |
const XMLCh* XmlBaseConditionCnv::commentString [private] |
Definition at line 122 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::keytypeString [private] |
Definition at line 123 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::valuetypeString [private] |
Definition at line 124 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::keyString [private] |
Definition at line 125 of file XmlBaseConditionCnv.h.
const XMLCh* XmlBaseConditionCnv::valueString [private] |
IXmlSvc* XmlGenericCnv::m_xmlSvc [protected, inherited] |
1.4.7