"That way you could avoid this repeated initialization:

    fEntityDeclPool->put(new DTDEntityDecl(gAmp, chAmpersand, true, true));
    fEntityDeclPool->put(new DTDEntityDecl(gLT, chOpenAngle, true, true));
    fEntityDeclPool->put(new DTDEntityDecl(gGT, chCloseAngle, true, true));
    fEntityDeclPool->put(new DTDEntityDecl(gQuot, chDoubleQuote, true,
true));
    fEntityDeclPool->put(new DTDEntityDecl(gApos, chSingleQuote, true,
true));

In pseudo code

   COLreferencePtr<DTDEntityDecl> fAmpersandEntity = new
DTDEntityDecl(gAmp, chAmpersand, true, true);
:
:
fEntityDeclPool->put(fAmpersandEntity)"


But, if you change the entity pool to work in terms of a smart pointer,
then you have to use smart pointers for all of the other entities that are
defined by the DTD, which can be considerable in something like PGML. You
slow down those in order to get a small speed up on these five special
ones. Can you show that this is really a win? If so, then I'll do it.

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]



Reply via email to