But what if the function and the functor creation is in the same class . I 
thought member function of the same class where functor creation is done will 
not require TypedMethod functor creation because we dont need an object to call 
a function in the same class. It should be same as when the function doesnt 
belong to any class where also we dont need any object . 
In the traverse sample , the function for the TypeMethod functor is in a 
different class.
Have I understood it wrong ?

-shailesh


On Thu, 02 Sep 2004 Gerrit Voss wrote :
>
>Hi,
>
>On Thu, 2004-09-02 at 06:19, shailesh kumar wrote:
> > one more question on functors :
> > I have a header file myclass.h which has the class myclass
> > myclass {
> > public :
> >     void func1(osg::NodePtr nptr,osg::UInt32 mask);
> >     ::Action::ResultE enterSetVisible(osg::NodePtr& node);
> > }
> >
> > and in myclass.cpp I have implemented the two functions like this :
> > ::Action::ResultE myclass::enterSetVisible(NodePtr& node)
> > {
> > /********* code ***********/
> > return ::Action::Continue;
> > }
> >
> > void SceneGraphAnalyser::func1(NodePtr nptr,UInt32 mask){
> >         traverse(nptr,             
> > osgTypedFunctionFunctor1CPtrRef<::Action::ResultE ,                         
> >                     NodePtr  >(myclass::enterSetVisible));
> >
> > }
> >
> >
> > on compiling I am getting the error :
> > error C2664: 'osg::osgTypedFunctionFunctor1CPtrRef' : cannot convert 
> > parameter 1 from 'osg::Action::ResultE (osg::NodePtr &)' to 
> > 'osg::Action::ResultE (__cdecl *)(osg::NodePtr &)'
> >
> > Any hints at why I am getting  this error will be very helpful .
>
>you try to pass  pass a member function whereas
>osgTypedFunctionFunctor1CPtrRef  expects a non-member/static member
>function. Either make the function static in your class or use either
>the TypedMethod or TypedStoredObject version of the functor creation
>function.
>
>regards,
>   gerrit
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by BEA Weblogic Workshop
>FREE Java Enterprise J2EE developer tools!
>Get your free copy of BEA WebLogic Workshop 8.1 today.
>http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
>_______________________________________________
>Opensg-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to