Hi Jason,

> To track the underlying C++ objects, Xerces-Perl keeps a pointer
> to the object, so all my method calls will be pointer invocations.

I don't understand what the problem is.  You can continue to keep a pointer,
or you can keep a smart pointer.  I have never done any Perl wrappers, but I
have done significant Python wrapping (not Xerces), and I know that I could
do it either way.

I thought you said you currently support the IDOM.  If you are happy with
that, then all you need to do is renamed IDOM_* to DOM*.  You don't have to
use the smart pointer handles if you don't want the benefit of automatic
calls to release, either because you will be explicitly calling release when
needed or you don't care about memory growth.  If you did decide to gain the
benefit of handles, then their being smart pointers would mean fewer updates
for you, not more, as the handles as smart pointers act quite a bit like the
raw pointers you are using today.

Am I missing something here?

Lenny

-----Original Message-----
From: Jason E. Stewart [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 06, 2002 10:35 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Tinny Ng
Subject: Re: Call for Vote: which one to be the Xerces-C++ public
supported W3C DOM interface


"Lenny Hoffman" <[EMAIL PROTECTED]> writes:

> The smart pointer approach should also be easier to explain in the
> programmers guide.  For example it can be explained that when wishing to
> have automated "in use" indication assign returned nodes to handles:
>
>    {
>       DOM_Element element = ...;
>       DOM_Node node = ...;
>       element->removeChild(node);
>       ...
>    } // release on removed child called here automatically
>
> Or if wishing to avoid handles assign to pointers and explicitly call
> release:
>
>    {
>       DOMElement* element = ...;
>       DOMNode* node = ...;
>       element->removeChild(node);
>       ...
>       node->release();
>    }

The smart pointer approach sounds clever. It has a serious drawback,
for me anyway, which is that it cannot work for the Perl API (or the
Python API most likely), at least not without significant hackery on my
part. To track the underlying C++ objects, Xerces-Perl keeps a pointer
to the object, so all my method calls will be pointer invocations.

Also, it will most likely mean the Xerces-C documentation becomes
significantly out of line with Xerces-Perl.

Smart pointers are also a bitch for people like me who only program in
C++ when we *have* to to try and figure out what other peoples code is
doing.

my $0.05,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to