subclassing pfNode types and cloning

New Message Reply Date view Thread view Subject view Author view

Jason Williams (jason++at++cerebus.cambridge.com)
Wed, 7 May 1997 09:12:19 -0400


Hi,

   I have subclassed the pfDCS node type and I am trying to clone instances of
these new class types. On the second attempt to clone such a node, my process
segment faults with the call stack stripped. It dies on my overriden nb_clone
member function for the new class. This is the clone function for the new
class OBJM_EntityNode:

pfNode*
OBJM_EntityNode::nb_clone()
{
        OBJM_EntityNode *newEntity;
           void *arena = pfMemory::getArena(this);
        int ii;

        newEntity = new OBJM_EntityNode;

        newEntity->copy(this);
        for (ii = 0;ii < getNumChildren();ii++) {
                newEntity->addChild(getChild(ii)->clone(0));
        }

        return((pfNode *) newEntity);

}

The OBJM_EntityNode class is a subclass of the pfDCS class type. Does anyone
have experience with doing this and subclassing pfNode types. Its hard to
believe that I am the first one trying to do this. Any help would be much
appreciated, and thanks in advance.

Jason ++at++ Cambridge Research Associates.

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:11 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.