"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]

Reply via email to