You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Hoseop Noh <br...@gmail.com> on 2008/03/25 02:16:37 UTC

Why DOMProcessingInstructionImpl member ver is private and not vertual..

HI

ask:
Why DOMPI member variable is private? and deleteData, substringData
functions is not virtual..

I develop DOM level 2 XML Mutation Event publishing..
I have no problem for develop DOMDocument, DOMElement, DOMText, DOMCDATA,
DOMComment...
 I use subclassing the xercesc DOM Node Implementation classes..

but I met problem at DOMProcessingInstructionImpl class..



this is current DOMProcessingInstructionImpl:
class CDOM_EXPORT DOMProcessingInstructionImpl: public
DOMProcessingInstruction {
*private:*
    DOMNodeImpl   fNode;
    DOMChildNode  fChild;
    // use fCharacterData to store its data so that those character
utitlites can be used
    DOMCharacterDataImpl   fCharacterData;

    XMLCh       *fTarget;
    const XMLCh *fBaseURI;

....

*    void         deleteData(XMLSize_t offset, XMLSize_t count);
    const XMLCh* substringData(XMLSize_t offset, XMLSize_t count) const;*

...

I want to deleteData, substringData functions to be virtual functions.. and
fNode, fParent, fNodeIDMap attribute to be protected

Re: Why DOMProcessingInstructionImpl member ver is private and not vertual..

Posted by Hoseop Noh <br...@gmail.com>.
Thank you very much!

2008/3/26, Boris Kolpackov <bo...@codesynthesis.com>:
>
> Boris Kolpackov <bo...@codesynthesis.com> writes:
>
> > I don't see any harm in making member variables in the
> > implementation classes protected for 3.0.0
>
> I've committed this change to SVN and it will be available in
> the upcoming 3.0.0.
>
> Boris
>
> --
> Boris Kolpackov, Code Synthesis Tools
> Open source XML data binding for C++:
> http://codesynthesis.com/products/xsd
> Mobile/embedded validating XML parsing:
> http://codesynthesis.com/products/xsde
>

Re: Why DOMProcessingInstructionImpl member ver is private and not vertual..

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Boris Kolpackov <bo...@codesynthesis.com> writes:

> I don't see any harm in making member variables in the
> implementation classes protected for 3.0.0

I've committed this change to SVN and it will be available in
the upcoming 3.0.0.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

Re: Why DOMProcessingInstructionImpl member ver is private and not vertual..

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi,

Hoseop Noh <br...@gmail.com> writes:

> I use subclassing the xercesc DOM Node Implementation classes..
>
> [...]
>
> I want to deleteData, substringData functions to be virtual
> functions.. and fNode, fParent, fNodeIDMap attribute to be
> protected

DOM implementation classes don't really have to expose any
of their implementation details to the outside world. If you
don't like what the default implementation does, you can
always provide your own (that is, derive your class from the
interface, not from the implementation, and  implement the
requested functionality from scratch). It can be a lot more
effort but then you get complete control.

I don't see any harm in making member variables in the
implementation classes protected for 3.0.0, however, making
internal functions virtual might have negative performance
consequences.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde