Re: [vos-d] Message handler problem

2007-03-17 Thread Reed Hedges
Another thought: does your derived class *have* to inherit Base virtually? Yes, basically. Well, in one case it doesn't and calling the method in the base class to register the handler works. In another case it has to be virtual. Maybe I can find a way to reorganize things to avoid it.

Re: [vos-d] Message handler problem

2007-03-16 Thread Ken Taylor
Reed Hedges wrote: For one thing, apparently you can't do this: class Base { public: virtual void pure() = 0; templateclass T register() { VobjectBase::registerHandlerT(message, handler); } void handler(Message *m) { ... } }; class VirtualDerived : public virtual

Re: [vos-d] Message handler problem

2007-03-15 Thread Peter Amstutz
That's something that was introduced by the new event tables implementation in 0.24. The solution is to make the registration function a templated class, and for the subclass to call the base class registration function with the subclass type to ensure that the method handlers are associated

Re: [vos-d] Message handler problem

2007-03-15 Thread Reed Hedges
For one thing, apparently you can't do this: class Base { public: virtual void pure() = 0; templateclass T register() { VobjectBase::registerHandlerT(message, handler); } void handler(Message *m) { ... } }; class VirtualDerived : public virtual Base { public:

Re: [vos-d] Message handler problem

2007-03-15 Thread Peter Amstutz
On Thu, Mar 15, 2007 at 04:11:41PM -0400, Reed Hedges wrote: Peter Amstutz wrote: That's something that was introduced by the new event tables implementation in 0.24. The solution is to make the registration function a templated class, and for the subclass to call the base class

Re: [vos-d] Message handler problem

2007-03-15 Thread Peter Amstutz
Try templateclass T register() { VobjectBase::registerHandlerT(message, T::handler); } (note T::handler) This should work, this is exactly how it works in s5. On Thu, Mar 15, 2007 at 04:49:17PM -0400, Reed Hedges wrote: For one thing, apparently you can't do this: class Base {

Re: [vos-d] Message handler problem

2007-03-15 Thread Ken Taylor
Ken Taylor wrote: Ken Taylor wrote: Reed Hedges wrote: Peter Amstutz wrote: Try templateclass T register() { VobjectBase::registerHandlerT(message, T::handler); } (note T::handler) Same problem -- it can't use the method in the base class when the