> I have a utility function that calls Xerces to do string transcoding.
This
> requires XMLPlatformUtils::Initialize() to be called. However, I can't
> guarantee that a random client calling me has called this before. At the
> same time, I can't just call it because the caller might be in the middle
of
> a parse.
Yes, you can. There's a counting scheme that keeps the library from being
initialized more than once. However, the initialization counting scheme is
not thread-safe, so you had better make sure multiple threads don't try to
initialize Xerces-C at the same time.
>
> How can I check if Xerces has been initialized already? I thought of
> checking the value of the pointer that I need
> (XMLPlatformUtils::fgTransService), but of course I won't be able to
tell.
> It will have a garbage value that looks just like a valid pointer.
No, I don't think it will -- it will either be a valid pointer, or 0. Some
investigation on your part could confirm this.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]