Reed Hedges wrote:
>
> For one thing, apparently you can't do this:
>
> class Base {
> public:
> virtual void pure() = 0;
> template<class T> register() {
> VobjectBase::registerHandler<T>("message", &handler);
> }
> void handler(Message *m) {
> ...
> }
> };
>
> class VirtualDerived : public virtual Base {
> public:
> VirtualDerived() {
> Base::register<VirtualDerived>();
> }
> virtual void pure() { ... };
> };
>
Another thought: does your derived class *have* to inherit Base virtually?
Are Base and VirtualDerived both meta-objects? Would there ever be a case
where you need to use multiple inheritance of two meta-objects? That
actually seems like a bad idea to me... If an object needs the functionality
of two meta-objects, just give it those types directly rather than making a
new meta-object class that tries to incorporate them both.
So if you don't ever need to multiply-inherit two meta-object types, there's
no need to inherit virutally. And if you don't inherit virtually, the
compiler should be able to convert (or if not, you should be able to cast) a
Base::* to a Derived::*, making the register() function work ok.
Still haven't tested it for myself, though :P
-Ken
_______________________________________________
vos-d mailing list
[email protected]
http://www.interreality.org/cgi-bin/mailman/listinfo/vos-d