#include <DetDescCnv/XmlGenericCnv.h>
Inheritance diagram for XmlGenericCnv:
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. | |
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 | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
virtual StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
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 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 | |
XmlGenericCnv (ISvcLocator *svc, const CLID &clid) | |
Constructor for this converter. | |
~XmlGenericCnv () | |
Default destructor. | |
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_createObj (xercesc::DOMElement *element, DataObject *&refpObject) |
This creates the transient representation of an object from the DOMElement representing it. | |
virtual StatusCode | i_fillObj (xercesc::DOMElement *childElement, DataObject *pObject, IOpaqueAddress *address) |
This fills the current object for its child element childElement. | |
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 Attributes | |
const XMLCh * | DDDBString |
const XMLCh * | materialsString |
const XMLCh * | versionString |
const XMLCh * | DTD_VersionString |
const XMLCh * | macroString |
const XMLCh * | nameString |
const XMLCh * | valueString |
const XMLCh * | parameterString |
const XMLCh * | detelemString |
const XMLCh * | conditionString |
const XMLCh * | classIDString |
bool | m_have_CONDDB_StorageType |
Flag that says if the storage type CONDDB_StorageType is accessible. |
It encapsulates the generic functionality required by any converter of this type. The actual converters are children of this one
Radovan Chytracek
Pere Mato
Definition at line 35 of file XmlGenericCnv.h.
XmlGenericCnv::XmlGenericCnv | ( | ISvcLocator * | svc, | |
const CLID & | clid | |||
) | [protected] |
Constructor for this converter.
svc | a ISvcLocator interface to find services | |
clid | the type of object the converter is able to convert |
XmlGenericCnv::~XmlGenericCnv | ( | ) | [protected] |
Default destructor.
virtual StatusCode XmlGenericCnv::initialize | ( | ) | [virtual] |
Initializes the converter.
Reimplemented from Converter.
Reimplemented in XmlBaseConditionCnv, and XmlBaseDetElemCnv.
virtual StatusCode XmlGenericCnv::finalize | ( | ) | [virtual] |
Finalizes the converter.
Reimplemented from Converter.
virtual StatusCode XmlGenericCnv::createObj | ( | IOpaqueAddress * | addr, | |
DataObject *& | refpObject | |||
) | [virtual] |
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] |
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] |
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] |
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] |
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] |
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] |
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] |
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_createObj | ( | xercesc::DOMElement * | element, | |
DataObject *& | refpObject | |||
) | [protected, virtual] |
This creates the transient representation of an object from the DOMElement representing it.
This actually does the "new" operation and deals with the attributes of the node. This should not deal with children of the node.
element | the DOMElement to be used to builds the object | |
refpObject | the object to be built |
Reimplemented in XmlBaseConditionCnv, XmlBaseDetElemCnv, XmlUserConditionCnv< DeType >, and XmlUserDetElemCnv< DeType >.
virtual StatusCode XmlGenericCnv::i_fillObj | ( | xercesc::DOMElement * | childElement, | |
DataObject * | pObject, | |||
IOpaqueAddress * | address | |||
) | [protected, virtual] |
This fills the current object for its child element childElement.
This will be called for each element child of the current object
childElement | the child processed here | |
pObject | the object to be filled | |
address | the address for this object |
Reimplemented in XmlBaseConditionCnv, and XmlBaseDetElemCnv.
virtual StatusCode XmlGenericCnv::i_fillObj | ( | xercesc::DOMText * | childText, | |
DataObject * | pObject, | |||
IOpaqueAddress * | address | |||
) | [protected, virtual] |
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] |
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] |
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] |
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] |
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] |
builds a standard string from a XMLCh*
domString | the XMLCh* |
IXmlSvc* XmlGenericCnv::m_xmlSvc [protected] |
const XMLCh* XmlGenericCnv::DDDBString [private] |
Definition at line 236 of file XmlGenericCnv.h.
const XMLCh* XmlGenericCnv::materialsString [private] |
Definition at line 237 of file XmlGenericCnv.h.
const XMLCh* XmlGenericCnv::versionString [private] |
const XMLCh* XmlGenericCnv::DTD_VersionString [private] |
Definition at line 239 of file XmlGenericCnv.h.
const XMLCh* XmlGenericCnv::macroString [private] |
Definition at line 240 of file XmlGenericCnv.h.
const XMLCh* XmlGenericCnv::nameString [private] |
Reimplemented in XmlBaseConditionCnv, and XmlBaseDetElemCnv.
Definition at line 241 of file XmlGenericCnv.h.
const XMLCh* XmlGenericCnv::valueString [private] |
const XMLCh* XmlGenericCnv::parameterString [private] |
Definition at line 243 of file XmlGenericCnv.h.
const XMLCh* XmlGenericCnv::detelemString [private] |
const XMLCh* XmlGenericCnv::conditionString [private] |
const XMLCh* XmlGenericCnv::classIDString [private] |
Definition at line 246 of file XmlGenericCnv.h.
bool XmlGenericCnv::m_have_CONDDB_StorageType [private] |
Flag that says if the storage type CONDDB_StorageType is accessible.
Definition at line 249 of file XmlGenericCnv.h.