I have the following situation and I'm not sure how to proceed. Currently
we have a class hierarchy that looks like this
class Base
class MiddleLayer : public Base
class Custom : public MiddleLayer
Now we have a third party set of classes that we need to integrate. I
consider this a "mix in" type of situation, where we just need that
behavior, but we can't alter the code (we don't have the source).
class ThirdParty : public Base
So the first idea off the top of my head is
class Custom : public MiddleLayer, public ThirdParty
The problem of course the lack of a virtual base class. What we really want
is
class MiddleLayer : virtual public Base
class ThirdParty : virtual public Base
But then we'd have to change the third party "source" code. I put "source"
in quotes because most people think of source code as the cpp file, while
they do send us the hpp header files (of course), and technically we could
change them. But I don't think that would be a very good idea. Any ideas
here? By the way, this is the first time this particular third party code
has been used in an actual production environment, so they might not have
thought fully through the problem, I'm not sure.