neilg 2003/10/10 11:37:51 Modified: c/src/xercesc/framework/psvi XSModel.cpp XSModel.hpp XSObject.cpp XSObject.hpp Log: update XSModel and XSObject interface so that IDs can be used to query components in XSModels, and so that those IDs can be recovered from components Revision Changes Path 1.2 +42 -1 xml-xerces/c/src/xercesc/framework/psvi/XSModel.cpp Index: XSModel.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSModel.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XSModel.cpp 16 Sep 2003 14:33:36 -0000 1.1 +++ XSModel.cpp 10 Oct 2003 18:37:51 -0000 1.2 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.2 2003/10/10 18:37:51 neilg + * update XSModel and XSObject interface so that IDs can be used to query components in XSModels, and so that those IDs can be recovered from components + * * Revision 1.1 2003/09/16 14:33:36 neilg * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them * @@ -65,7 +68,30 @@ XERCES_CPP_NAMESPACE_BEGIN -XSModel::XSModel( MemoryManager* const manager ): +/** + * The constructor to be used wen a grammar pool contains all needed info + * + * @param grammarPool the grammar pool containing the underlying data structures + * @param manager The configurable memory manager + */ +XSModel::XSModel( XMLGrammarPool *grammarPool + , MemoryManager* const manager ): + fMemoryManager(manager) +{ +} + +/** + * The constructor to be used when the XSModel must represent all + * components in the union of an existing XSModel and a newly-created + * Grammar + * + * @param baseModel the XSModel upon which this one is based + * @param grammar the newly-created grammar whose components are to be merged + * @param manager The configurable memory manager + */ +XSModel::XSModel( XSModel *baseModel + , Grammar *grammar + , MemoryManager* const manager ): fMemoryManager(manager) { } @@ -224,6 +250,21 @@ , const XMLCh *compNamespace) { // REVISIT + return 0; +} + +/** + * Optional. Return a component given a component type and a unique Id. + * May not be supported for all component types. + * @param compId unique Id of the component within its type + * @param compType type of the component + * @return the component of the given type with the given Id, or 0 + * if no such component exists or this is unsupported for + * this type of component. + */ +XSObject *XSModel::getXSObjectById(unsigned int compId + , XSConstants::COMPONENT_TYPE compType) +{ return 0; } 1.2 +34 -3 xml-xerces/c/src/xercesc/framework/psvi/XSModel.hpp Index: XSModel.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSModel.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XSModel.hpp 16 Sep 2003 14:33:36 -0000 1.1 +++ XSModel.hpp 10 Oct 2003 18:37:51 -0000 1.2 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.2 2003/10/10 18:37:51 neilg + * update XSModel and XSObject interface so that IDs can be used to query components in XSModels, and so that those IDs can be recovered from components + * * Revision 1.1 2003/09/16 14:33:36 neilg * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them * @@ -83,6 +86,8 @@ */ // forward declarations +class Grammar; +class XMLGrammarPool; class XSAnnotation; class XSAttributeDeclaration; class XSAttributeGroupDefinition; @@ -102,12 +107,26 @@ //@{ /** - * The default constructor + * The constructor to be used wen a grammar pool contains all needed info * + * @param grammarPool the grammar pool containing the underlying data structures * @param manager The configurable memory manager */ - XSModel( - MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); + XSModel( XMLGrammarPool *grammarPool + , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); + + /** + * The constructor to be used when the XSModel must represent all + * components in the union of an existing XSModel and a newly-created + * Grammar + * + * @param baseModel the XSModel upon which this one is based + * @param grammar the newly-created grammar whose components are to be merged + * @param manager The configurable memory manager + */ + XSModel( XSModel *baseModel + , Grammar *grammar + , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); //@}; @@ -231,6 +250,18 @@ */ XSNotationDeclaration *getNotationDeclaration(const XMLCh *name , const XMLCh *compNamespace); + + /** + * Optional. Return a component given a component type and a unique Id. + * May not be supported for all component types. + * @param compId unique Id of the component within its type + * @param compType type of the component + * @return the component of the given type with the given Id, or 0 + * if no such component exists or this is unsupported for + * this type of component. + */ + XSObject *getXSObjectById(unsigned int compId + , XSConstants::COMPONENT_TYPE compType); // @} 1.3 +15 -1 xml-xerces/c/src/xercesc/framework/psvi/XSObject.cpp Index: XSObject.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XSObject.cpp 17 Sep 2003 17:45:37 -0000 1.2 +++ XSObject.cpp 10 Oct 2003 18:37:51 -0000 1.3 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.3 2003/10/10 18:37:51 neilg + * update XSModel and XSObject interface so that IDs can be used to query components in XSModels, and so that those IDs can be recovered from components + * * Revision 1.2 2003/09/17 17:45:37 neilg * remove spurious inlines; hopefully this will make Solaris/AIX compilers happy. * @@ -91,6 +94,17 @@ } XSNamespaceItem *XSObject::getNamespaceItem() +{ + return 0; +} + +/** + * Optional. return a unique identifier for a component within this XSModel, to + * optimize querying. May not be defined for all component types. + * @return id unique for this type of component within this XSModel + * or 0 to indicate that this is unsupported for this type of component. + */ +inline unsigned int XSObject::getId() const { return 0; } 1.2 +11 -0 xml-xerces/c/src/xercesc/framework/psvi/XSObject.hpp Index: XSObject.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSObject.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XSObject.hpp 16 Sep 2003 14:33:36 -0000 1.1 +++ XSObject.hpp 10 Oct 2003 18:37:51 -0000 1.2 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.2 2003/10/10 18:37:51 neilg + * update XSModel and XSObject interface so that IDs can be used to query components in XSModels, and so that those IDs can be recovered from components + * * Revision 1.1 2003/09/16 14:33:36 neilg * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them * @@ -133,6 +136,14 @@ * otherwise. */ virtual XSNamespaceItem *getNamespaceItem(); + + /** + * Optional. Return a unique identifier for a component within this XSModel, to + * optimize querying. May not be defined for all types of component. + * @return id unique for this type of component within this XSModel or 0 + * to indicate that this is not supported for this type of component. + */ + virtual unsigned int getId() const; //@}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]