Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

DWFToolkit::DWFObjectDefinitionReader Class Reference
[DWF Package API]

#include "dwf/package/reader/ObjectDefinitionReader.h"

Inheritance diagram for DWFToolkit::DWFObjectDefinitionReader:

Inheritance graph
[legend]
Collaboration diagram for DWFToolkit::DWFObjectDefinitionReader:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements the required XML parsing handlers to compose toolkit objects from the object definitions documents and provide them via the typed callbacks.
Since:
7.0.1.

This class contains the processing logic particular to the known versions of the object definition documents. The algorithm is tuned specifically for this schema and is not intended to be generic.

Todo:
Provide filtering for object definition parsing.

Definition at line 57 of file ObjectDefinitionReader.h.

Public Types

enum  teProviderType {
  eProvideNone = 0x00, eProvideVersion = 0x01, eProvideProperties = 0x02, eProvideObjects = 0x04,
  eProvideInstances = 0x08, eProvideAttributes = 0x01, eProvideElements = 0x0E, eProvideAll = 0xFF
}

Public Member Functions

_DWFTK_API DWFObjectDefinitionReader (DWFPackageReader *pPackageReader=NULL, unsigned char nProviderFlags=eProvideAll) throw ()
virtual _DWFTK_API ~DWFObjectDefinitionReader () throw ()
virtual _DWFTK_API void provideVersion (double nVersion) throw ()
virtual _DWFTK_API void provideProperties (const DWFString &zID, vector< DWFString > *pPropertyRefs, DWFProperty::tList *pPropertyList) throw ()
virtual _DWFTK_API void provideObject (DWFDefinedObject *pObject) throw ()
virtual _DWFTK_API void provideInstance (DWFDefinedObjectInstance *pInstance) throw ()
_DWFTK_API void notifyStartElement (const char *zName, const char **ppAttributeList) throw ()
_DWFTK_API void notifyEndElement (const char *zName) throw ()
_DWFTK_API void notifyStartNamespace (const char *zPrefix, const char *zURI) throw ()
_DWFTK_API void notifyEndNamespace (const char *zPrefix) throw ()
_DWFTK_API void notifyCharacterData (const char *zCData, int nLength) throw ()

Protected Attributes

DWFPackageReader_pPackageReader
DWFXMLElementBuilder _oDefaultElementBuilder
DWFXMLElementBuilder_pElementBuilder


Member Enumeration Documentation

enum DWFToolkit::DWFObjectDefinitionReader::teProviderType
 

These enumeration flags alter the behavior of the parser by restricting which elements are inflated into runtime objects. Generally these only prevent unwanted object creation (and thus memory allocations) but in some cases, additional data processing can be avoided.

Enumeration values:
eProvideNone  Parse the document only (no data objects will be created; no callbacks will be invoked.)
eProvideVersion  Invoke the provideVersion() attribute callback.
eProvideProperties  Invoke the provideProperties() element callback.
eProvideObjects  Invoke the provideObject() element callback.
eProvideInstances  Invoke the provideInstance() element callback.
eProvideAttributes  Equivalent to eProvideVersion
eProvideElements  Equivalent to (eProvideProperties | eProvideObjects | eProvideInstances)
eProvideAll  Equivalent to (eProvideAttributes | eProvideElements)

Definition at line 69 of file ObjectDefinitionReader.h.


Constructor & Destructor Documentation

_DWFTK_API DWFToolkit::DWFObjectDefinitionReader::DWFObjectDefinitionReader DWFPackageReader pPackageReader = NULL,
unsigned char  nProviderFlags = eProvideAll
throw ()
 

Constructor

Parameters:
pPackageReader Provides the manifest document stream.
nProviderFlags A combination of teProviderType flags.
Exceptions:
None 

virtual _DWFTK_API DWFToolkit::DWFObjectDefinitionReader::~DWFObjectDefinitionReader  )  throw () [virtual]
 

Destructor

Exceptions:
None 


Member Function Documentation

_DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::notifyCharacterData const char *  zCData,
int  nLength
throw () [virtual]
 

This method is notified by the static XML_CharacterDataHandler Expat parser callback function.

It is possible that this callback will be invoked a number of times for a single CDATA block; there is no requirement that zCData contain all the text in the block.

Todo:
Notifications for XML_StartCdataSectionHandler and XML_EndCdataSectionHandler static callbacks are currently not implemented and should be.
Parameters:
zCData A non-null-terminated string of CDATA.
nLength The number of characters in zCData.
Exceptions:
None 

Implements DWFToolkit::DWFXMLCallback.

_DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::notifyEndElement const char *  zName  )  throw () [virtual]
 

This method is notified by the static XML_EndElementHandler Expat parser callback function.

Parameters:
zName The name of the element (includes any namespace prefix)
Exceptions:
None 

Implements DWFToolkit::DWFXMLCallback.

_DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::notifyEndNamespace const char *  zPrefix  )  throw () [virtual]
 

This method is notified by the static XML_EndNamespaceDeclHandler Expat parser callback function.

This callback is not currently used.

Parameters:
zPrefix The namespace prefix.
Exceptions:
None 

Implements DWFToolkit::DWFXMLCallback.

_DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::notifyStartElement const char *  zName,
const char **  ppAttributeList
throw () [virtual]
 

This method is notified by the static XML_StartElementHandler Expat parser callback function.

Attribute list processing example:

                 size_t iAttrib = 0;
       
                 for(; ppAttributeList[iAttrib]; iAttrib += 2)
                 {
                    //
                    // dump attribute 
                    //
                    cout << "Attribute Name: " << ppAttributeList[iAttrib] << " ";
                    cout << "Attribute Value: " << ppAttributeList[iAttrib+1] << endl;
                }

Parameters:
zName The name of the element (includes any namespace prefix)
ppAttributeList An array of null-terminated atribute name, value string pairs. The array itself is zero-terminated.
Exceptions:
None 

Implements DWFToolkit::DWFXMLCallback.

_DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::notifyStartNamespace const char *  zPrefix,
const char *  zURI
throw () [virtual]
 

This method is notified by the static XML_StartNamespaceDeclHandler Expat parser callback function.

This callback is not currently used.

Parameters:
zPrefix The namespace prefix.
zURI The namespace URI (may be NULL).
Exceptions:
None 

Implements DWFToolkit::DWFXMLCallback.

virtual _DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::provideInstance DWFDefinedObjectInstance pInstance  )  throw () [virtual]
 

Accepts defined object instance elements.

Parameters:
pInstance The new defined object instance. The acceptor is responsible for deleting this pointer with DWFCORE_FREE_OBJECT.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFObjectDefinition.

virtual _DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::provideObject DWFDefinedObject pObject  )  throw () [virtual]
 

Accepts defined object elements.

Parameters:
pObject The new defined object. The acceptor is responsible for deleting this pointer with DWFCORE_FREE_OBJECT.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFObjectDefinition.

virtual _DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::provideProperties const DWFString zID,
vector< DWFString > *  pPropertyRefs,
DWFProperty::tList pPropertyList
throw () [virtual]
 

Accepts properties and property set references.

Parameters:
zID The identifier of the incoming property set.
pPropertyRefs A list of property set references (by ID). The acceptor is responsible for deleting this pointer with DWFCORE_FREE_OBJECT.
pPropertyList The properties that comprise this set. The acceptor is responsible for deleting this pointer with DWFCORE_FREE_OBJECT.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFObjectDefinition.

virtual _DWFTK_API void DWFToolkit::DWFObjectDefinitionReader::provideVersion double  nVersion  )  throw () [virtual]
 

Accepts the object definition document version number attribute.

Parameters:
nVersion The document version.
Returns:
The filtered document version.
Exceptions:
None 

Reimplemented in DWFToolkit::DWFObjectDefinition.


Member Data Documentation

DWFXMLElementBuilder DWFToolkit::DWFObjectDefinitionReader::_oDefaultElementBuilder [protected]
 

Default building behavior and element object allocator for readers.

Definition at line 231 of file ObjectDefinitionReader.h.

DWFXMLElementBuilder* DWFToolkit::DWFObjectDefinitionReader::_pElementBuilder [protected]
 

This will point to the default builder initially. But implementation classes can alter this pointer as necessary but they should all use only this pointer to do the actual work.

Definition at line 238 of file ObjectDefinitionReader.h.

DWFPackageReader* DWFToolkit::DWFObjectDefinitionReader::_pPackageReader [protected]
 

DWF package content source.

Definition at line 225 of file ObjectDefinitionReader.h.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:39:05 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1