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.
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
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
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:
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
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 {
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