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

In This Package:

XmlGenericCnv Class Reference

Base class for the XML converters. More...

#include <DetDescCnv/XmlGenericCnv.h>

Inheritance diagram for XmlGenericCnv:

[legend]
Collaboration diagram for XmlGenericCnv:
[legend]
List of all members.

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.
IXmlSvcxmlSvc ()
 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 IDataProviderSvcdataProvider () const
virtual StatusCode setConversionSvc (IConversionSvc *svc)
virtual IConversionSvcconversionSvc () const
virtual StatusCode setAddressCreator (IAddressCreator *creator)
virtual IAddressCreatoraddressCreator () const
virtual const CLIDobjType () 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 InterfaceIDinterfaceID ()

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.
IOpaqueAddresscreateAddressForHref (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:/".
IOpaqueAddresscreateXmlAddress (std::string location, std::string entryName, CLID clid) const
 This creates an XmlAddress using the location, entryName and clid.
IOpaqueAddresscreateCondDBAddress (std::string path, std::string entryName, unsigned long channelId, CLID clid) const
 This creates a ConddbAddress using the location, entryName, channelID and clid.
ISvcLocatorserviceLocator () const
IMessageSvcmsgSvc () const
IMessageSvcmessageService () const
IDataManagerSvcdataManager () const

Static Protected Member Functions

static const std::string dom2Std (const XMLCh *domString)
 builds a standard string from a XMLCh*

Protected Attributes

IXmlSvcm_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.

Detailed Description

Base class for the XML converters.

It encapsulates the generic functionality required by any converter of this type. The actual converters are children of this one

Author:
Sebastien Ponce

Radovan Chytracek

Pere Mato

Definition at line 35 of file XmlGenericCnv.h.


Constructor & Destructor Documentation

XmlGenericCnv::XmlGenericCnv ( ISvcLocator svc,
const CLID clid 
) [protected]

Constructor for this converter.

Parameters:
svc a ISvcLocator interface to find services
clid the type of object the converter is able to convert

XmlGenericCnv::~XmlGenericCnv (  )  [protected]

Default destructor.


Member Function Documentation

virtual StatusCode XmlGenericCnv::initialize (  )  [virtual]

Initializes the converter.

Returns:
status depending on the completion of the call

Reimplemented from Converter.

Reimplemented in XmlBaseConditionCnv, and XmlBaseDetElemCnv.

virtual StatusCode XmlGenericCnv::finalize (  )  [virtual]

Finalizes the converter.

Returns:
status depending on the completion of the call

Reimplemented from Converter.

virtual StatusCode XmlGenericCnv::createObj ( IOpaqueAddress addr,
DataObject *&  refpObject 
) [virtual]

Creates the transient representation of an object.

Parameters:
addr the address of the object representation
refpObject the object created
Returns:
status depending on the completion of the call

Reimplemented from Converter.

virtual StatusCode XmlGenericCnv::updateObj ( IOpaqueAddress pAddress,
DataObject pObject 
) [virtual]

Updates the transient object from the other representation.

Parameters:
pAddress the address of the object representation
pObject the object updated
Returns:
status depending on the completion of the call

Reimplemented from Converter.

virtual StatusCode XmlGenericCnv::createRep ( DataObject pObject,
IOpaqueAddress *&  refpAddress 
) [virtual]

Converts the transient object to the requested representation.

Parameters:
refpAddress the address of the object representation
pObject the object to convert
Returns:
status depending on the completion of the call

Reimplemented from Converter.

virtual StatusCode XmlGenericCnv::updateRep ( IOpaqueAddress pAddress,
DataObject pObject 
) [virtual]

Updates the converted representation of a transient object.

Parameters:
pAddress the address of the object representation
pObject the object whose representation has to be updated
Returns:
status depending on the completion of the call

Reimplemented from Converter.

IXmlSvc* XmlGenericCnv::xmlSvc (  )  [inline]

Accessor to the IXmlSvc interface of the XmlCnvSvc service.

Returns:
the IXmlSvc interface of this object

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.

Returns:
the storage type for this object

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.

Returns:
the storage type for this object

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.

Parameters:
element the DOMElement to be used to builds the object
refpObject the object to be built
address the address for this object
Returns:
status depending on the completion of the call

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.

Parameters:
element the DOMElement to be used to builds the object
refpObject the object to be built
Returns:
status depending on the completion of the call

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

Parameters:
childElement the child processed here
pObject the object to be filled
address the address for this object
Returns:
status depending on the completion of the call

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

Parameters:
childText the child processed here
pObject the object to be filled
address the address for this object
Returns:
status depending on the completion of the call

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

Parameters:
pObject the object to be processed
address the address for this object
Returns:
status depending on the completion of the call

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.

Parameters:
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.
Returns:
the new Address

IOpaqueAddress* XmlGenericCnv::createXmlAddress ( std::string  location,
std::string  entryName,
CLID  clid 
) const [protected]

This creates an XmlAddress using the location, entryName and clid.

Parameters:
location the location string for this address
entryName the entryName string for this address
clid the clidof the address to create
Returns:
the new Address

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.

Parameters:
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
Returns:
the new Address

static const std::string XmlGenericCnv::dom2Std ( const XMLCh *  domString  )  [static, protected]

builds a standard string from a XMLCh*

Parameters:
domString the XMLCh*
Returns:
a standard string with the same characters


Member Data Documentation

IXmlSvc* XmlGenericCnv::m_xmlSvc [protected]

the IXmlSvc interface of this object

Definition at line 231 of file XmlGenericCnv.h.

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]

Reimplemented in XmlBaseDetElemCnv.

Definition at line 238 of file XmlGenericCnv.h.

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]

Reimplemented in XmlBaseConditionCnv.

Definition at line 242 of file XmlGenericCnv.h.

const XMLCh* XmlGenericCnv::parameterString [private]

Definition at line 243 of file XmlGenericCnv.h.

const XMLCh* XmlGenericCnv::detelemString [private]

Reimplemented in XmlBaseDetElemCnv.

Definition at line 244 of file XmlGenericCnv.h.

const XMLCh* XmlGenericCnv::conditionString [private]

Reimplemented in XmlBaseDetElemCnv.

Definition at line 245 of file XmlGenericCnv.h.

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.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

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