Click here to Skip to main content
16,019,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
PJ Arends24-Feb-05 15:34
professionalPJ Arends24-Feb-05 15:34 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip25-Feb-05 5:43
moredip25-Feb-05 5:43 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
Ryan Binns24-Feb-05 17:50
Ryan Binns24-Feb-05 17:50 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip25-Feb-05 6:00
moredip25-Feb-05 6:00 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
Ryan Binns26-Feb-05 19:10
Ryan Binns26-Feb-05 19:10 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip1-Mar-05 5:46
moredip1-Mar-05 5:46 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
Ravi Bhavnani25-Feb-05 3:55
professionalRavi Bhavnani25-Feb-05 3:55 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip25-Feb-05 5:57
moredip25-Feb-05 5:57 
Hi Ravi, thanks for the reply.

I think maybe I'm misunderstanding, but I think you're saying I should perhaps do something like:

class IClonable
{
public:
  virtual ~IClonable()
  {}

  virtual IClonable *CreateClone() = 0;
};

class ICamera : public ICloneable
{
   //...
};

class IOrientation : public ICloneable
{
   //...
};

class C3DCamera : public ICamera, public IOrientation
{
public:
   //...
   ICloneable *CreateClone();
}


Is that correct?

So in this scheme clients of IClonable would presumably be static_cast<>ing the result of CreateClone()? Sounds sensible to me. I'm vaguely worried about the whole 'Diamond Inheritance Considered Evil' thing, but from my understanding (which I admit isn't great), the evilness doesn't apply to abstract base classes, right?

One final thing. You mention creating a common IImagingLibObject interface. I don't understand the reason for doing that.

Again, thanks for the advice!

Pete
GeneralRe: muliple-inheriting two functions with identical signatures Pin
cmk25-Feb-05 11:40
cmk25-Feb-05 11:40 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip25-Feb-05 12:04
moredip25-Feb-05 12:04 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
cmk25-Feb-05 16:12
cmk25-Feb-05 16:12 
GeneralRe: muliple-inheriting two functions with identical signatures Pin
moredip1-Mar-05 5:41
moredip1-Mar-05 5:41 
GeneralUSB Port Pin
Member 47204524-Feb-05 11:11
Member 47204524-Feb-05 11:11 
GeneralRe: USB Port Pin
namaskaaram24-Feb-05 21:34
namaskaaram24-Feb-05 21:34 
GeneralAssigning Member Variables to Controls Pin
Veronique72224-Feb-05 10:04
Veronique72224-Feb-05 10:04 
GeneralRe: Assigning Member Variables to Controls Pin
David Crow24-Feb-05 10:31
David Crow24-Feb-05 10:31 
GeneralRe: Assigning Member Variables to Controls Pin
Veronique72224-Feb-05 10:39
Veronique72224-Feb-05 10:39 
GeneralRe: Assigning Member Variables to Controls Pin
wilsonian24-Feb-05 14:09
wilsonian24-Feb-05 14:09 
GeneralRe: Assigning Member Variables to Controls Pin
Veronique72225-Feb-05 2:51
Veronique72225-Feb-05 2:51 
GeneralRe: Assigning Member Variables to Controls Pin
rbid25-Feb-05 21:21
rbid25-Feb-05 21:21 
GeneralTerminate process Pin
superstar441024-Feb-05 9:14
susssuperstar441024-Feb-05 9:14 
GeneralRe: Terminate process Pin
David Crow24-Feb-05 9:19
David Crow24-Feb-05 9:19 
GeneralRe: Terminate process Pin
superstar441024-Feb-05 9:35
susssuperstar441024-Feb-05 9:35 
GeneralRe: Terminate process Pin
David Crow24-Feb-05 9:39
David Crow24-Feb-05 9:39 
GeneralRe: Terminate process Pin
superstar441024-Feb-05 10:21
susssuperstar441024-Feb-05 10:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.