[USRP-users] C++ Idiom for Deriving from multi_usrp?

Sylvain Munaut 246tnt at gmail.com
Fri Jul 17 10:26:24 EDT 2015


> Is there a useful C++ idiom for deriving a new class from
> uhd::usrp::multi_usrp that preserves the functionality provided by
> multi_usrp_impl, but allows the new class to redefine member functions and
> add new ones?

Not without having access to the _impl class no ...

(so you'd need to have the UHD sources and private headers accessible
when building your extension)

> Am I missing a reason why deriving a new class this way is a bad idea, or
> just not seeing the easy way to do it?

It's not that it's a bad idea ... it's just not really possible.

It was apparently deemed that the advantage of the _impl model were
more important than the ability to use inheritance externally.

Now if you're willing to dig deep and be completely non portable, you
can start playing with the vtables and stuff like that but it's not
what I'd call _easy_.



More information about the USRP-users mailing list