Re: ->setTravFuncs

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Wed, 14 May 1997 11:17:13 -0700


On May 13, 5:32pm, Les Elkins wrote:
> Subject: Re: ->setTravFuncs
> >
> > I recive the warning:
> >
> > warning(3676): pointer-to-member-function cast to pointer
> > to function
> >
> > mv_body->setTravFuncs(PFTRAV_CULL,(pfNodeTravFuncType)walk,NULL);
>
> I just had the same problem a couple of days ago, in that the C++
> compiler would not let me make a reference to a member function in
> anything other than an invocation. I assume this is disallowed to
> make dealing with virtual functions easier.

You must understand that in C++ a pointer-to-non-static-member-function is
generally not compatible with a pointer-to-function. Attempting such a cast is
fundamentally a programming error.

You can make your walk member function static and set the traversal data with
the this pointer for the current object of your class. For example:

class people
{
  public:
    static int walk( pfTraverser*, void* );
};

NOTE: that your object must be in shared memory to be visible in the CULL
process and if you derive from a Performer libpf class then the CULL process
will only see the Performer subobject due to multibuffer "slicing". This is
explained in the Performer Programming Guide, Chapter #14, page 495-496.

Regards.

--
+ Marcus Barnes, Technical Staff        mailto:marcus++at++multigen.com +
+ Multigen Inc.                         http://www.multigen.com    +
+ 550 S. Winchester Blvd.               phoneto:1-408-556-2654     +
+ Suite 500 San Jose CA 95128           faxto:1-408-261-4102       +
=======================================================================
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:13 PDT

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