If I want to implement two distinct Ice interfaces in one class, I have to manually forward the Ice::Object internal methods to ::Ice::Object, or else suffer g++'s "no unique final overrider" wrath. Rather than duplicate the (considerable) typing every time I hit one of those, or write one-off slice interfaces to have slice2cpp generate the forwarding for me -- at some code size cost as well -- I use the following macro:
Code:
#define ICE_FORWARD_ICE_OBJECT_METHODS \
virtual bool ice_isA(const std::string& i, const ::Ice::Current& c) const { return ::Ice::Object::ice_isA(i, c); } \
virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& c = ::Ice::Current()) const { return ::Ice::Object::ice_ids(c); } \
virtual const ::std::string& ice_id(const ::Ice::Current& c= ::Ice::Current()) const { return ::Ice::Object::ice_id(c); } \
virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming& i, const ::Ice::Current& c) { return ::Ice::Object::__dispatch(i, c); } \
virtual void __write(::IceInternal::BasicStream* s, bool b) const { ::Ice::Object::__write(s, b); } \
virtual void __read(::IceInternal::BasicStream* s, bool b = true) { ::Ice::Object::__read(s, b); } \
virtual void __gcReachable(::IceUtil::GCObjectMultiSet& ms) const { ::Ice::Object::__gcReachable(ms); } \
virtual void __gcClear() { ::Ice::Object::__gcClear(); }
I think it would look quite spiffy in Ice/Object.h, myself!
Mike