|
|
multiple inheritance usage
Hi all.
I have designed some class hiecracy:
shape -> shape3d -> ball
-> cylinder
-> parallelogram
-> randshape
Also I have a material class. And now I want to create the class which describe fragment properties (from HE shell). There is no problem to inherit material class, but I can not understand how to inherit ball, cyl, para & randshape classes, because I need to inherit only one class in different instances of fragment class. Now I save variations of shape3d classes in fragment class as property. Is there any way to do it without creating a property?
|
|
0
|
|
|
|
Reply
|
m4
|
12/13/2010 2:55:32 PM |
|
Guys, the question remains valid. Can I do something not clearly explained?
|
|
0
|
|
|
|
Reply
|
m4
|
12/16/2010 12:12:05 PM
|
|
"m4 Chrennikov" <abrek77@gmail.com> wrote in message <ie5c54$5eb$1@fred.mathworks.com>...
> Hi all.
> I have designed some class hiecracy:
> shape -> shape3d -> ball
> -> cylinder
> -> parallelogram
> -> randshape
> Also I have a material class. And now I want to create the class which describe fragment properties (from HE shell). There is no problem to inherit material class, but I can not understand how to inherit ball, cyl, para & randshape classes, because I need to inherit only one class in different instances of fragment class. Now I save variations of shape3d classes in fragment class as property. Is there any way to do it without creating a property?
It's not clear to me what you want to do.
classdef myclass < material & randshape & ....
mc1 = myclass;
mc2 = myclass;
AFAIK there it is not possible to let mc1 inherit ball and mc2 inherit cylinder. However, I guess you can make new classes on the fly. I wouldn't.
Why not use composition?
/ per
|
|
0
|
|
|
|
Reply
|
per
|
12/16/2010 2:38:06 PM
|
|
"per isakson" wrote in message <ied88e$a97$1@fred.mathworks.com>...
> AFAIK there it is not possible to let mc1 inherit ball and mc2 inherit cylinder. However, I guess you can make new classes on the fly. I wouldn't.
>
> Why not use composition?
>
> / per
How can I make classes on the fly? Could you tell more about this?
Can you provide some links about composition?
|
|
0
|
|
|
|
Reply
|
m4
|
1/17/2011 11:54:04 AM
|
|
|
3 Replies
323 Views
(page loaded in 0.053 seconds)
Similiar Articles: multiple inheritance usage - comp.soft-sys.matlabHi all. I have designed some class hiecracy: shape -> shape3d -> ball -> cylinder -> parallelo... Multiple of Inherited Sample Time - comp.soft-sys.matlab ...Multiple Instances of program - comp.unix.programmer multiple inheritance usage - comp.soft-sys.matlab... need to inherit only one class in different instances of ... Multiple file advantage//disadvantange? - comp.databases.filemaker ...multiple inheritance usage - comp.soft-sys.matlab On the other hand, to use inheritance, you have to make everything needed by the ... Multiple file advantage ... multiple GUI position - comp.soft-sys.matlabHi, I created a multiple GUI which manages a database, picks data according ... multiple inheritance usage - comp.soft-sys.matlab Help with Interface RAD - comp.databases ... Best design for my classes to avoid code duplication? - comp.lang ...multiple inheritance usage - comp.soft-sys.matlab Best design for my classes to avoid code duplication? - comp.lang ... On the other hand, to use inheritance, you have to ... Should I use C++ or Java for Numeric Intensive Calculations - comp ...multiple inheritance usage - comp.soft-sys.matlab Should I use C++ or Java for Numeric Intensive Calculations - comp ... C++ uses multiple inheritance, which Java doesn't ... Enum type inside a class (matlab <-> java interface) - comp.soft ...Alternately, use the method I used for system-tray messages, which has ... multiple inheritance usage - comp.soft-sys.matlab Enum type inside a class (matlab <-> java ... Bridge patterns and protected inheritance? - comp.lang.c++ ...Hi, I have a question regarding the use of the Bridge design pattern. ... Well, the most typical anti-pattern is ... functions, interfaces/multiple inheritance, the ... Misuses of RTTI - comp.lang.c++.moderatedDo not use it as a shortcut around ... as virtual functions, interfaces/multiple inheritance, the Visitor type-discovery pattern, and so forth. Sometimes we can use ... exact difference between C style and static_cast, const_cast ...This can be significant when dealing with multiple inheritance. -- [ See http ... obj) == typeid(foo)) { foo* foo = static_cast ... have to use self written ... Multiple inheritance - Wikipedia, the free encyclopediaMultiple inheritance is a feature of some object-oriented computer programming languages in which a class can inherit behaviors and features from more than one ... Multiple inheritance in C++ tutorial - Cprogramming.comAn introduction to multiple inheritance in C++ ... Multiple Inheritance in C++ by Andrei Milea Using multiple inheritance in C++ 7/23/2012 10:27:33 AM
|
|
|
|
|
|
|
|
|