Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: function access in base and derived classes Pin
JudyL_MD22-Dec-09 16:24
JudyL_MD22-Dec-09 16:24 
GeneralRe: function access in base and derived classes Pin
Tim Craig22-Dec-09 17:06
Tim Craig22-Dec-09 17:06 
QuestionRe: function access in base and derived classes Pin
Avi Berger22-Dec-09 18:49
Avi Berger22-Dec-09 18:49 
AnswerRe: function access in base and derived classes Pin
Tim Craig22-Dec-09 18:58
Tim Craig22-Dec-09 18:58 
GeneralRe: function access in base and derived classes [modified] Pin
Avi Berger22-Dec-09 19:21
Avi Berger22-Dec-09 19:21 
GeneralRe: function access in base and derived classes Pin
Tim Craig22-Dec-09 21:36
Tim Craig22-Dec-09 21:36 
GeneralRe: function access in base and derived classes Pin
JudyL_MD23-Dec-09 2:20
JudyL_MD23-Dec-09 2:20 
GeneralRe: function access in base and derived classes Pin
Tim Craig23-Dec-09 9:31
Tim Craig23-Dec-09 9:31 
I've dealt with a lot of hardware, too. Primarily instrumentation and now robots, that's why I suggested the "has-a", or maybe in this case "uses-a" or "controls-a", relationship with your hardware class. Instead of inheriting from the hardware, the more abstract class simply contains an instance of hardware class or a pointer to "the" instance depending on whether you allow more than one instance of the hardware to exist at a time. This way it only can use the public interface you provide yet still. It isn't a hardware abstraction class but a hardware control class.

In your car class, the car isn't really an engine, it's a collection of parts of which the engine is simply one. The car "has-a" engine. Maybe one of the more important parts but just a part like wheels, tires, windows. In your model the driver would inherit from car while in mine the driver becomes the car controller. The driver doesn't have to know or access all the nitty gritty details of how a car works (that make us MEs drool) but just understand the interface to drive it. Just like the car itself doesn't have to know what kind of engine it has, just the interface to the throttle, fuel system, etc, to get it running and control it.

You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

GeneralRe: function access in base and derived classes Pin
JudyL_MD23-Dec-09 10:08
JudyL_MD23-Dec-09 10:08 
Questionfatal error RC1015: cannot open include file 'res\Test.rc2' Pin
iwt.dev22-Dec-09 7:39
iwt.dev22-Dec-09 7:39 
AnswerRe: fatal error RC1015: cannot open include file 'res\Test.rc2' Pin
dxlee22-Dec-09 8:46
dxlee22-Dec-09 8:46 
AnswerRe: fatal error RC1015: cannot open include file 'res\Test.rc2' Pin
Abhi Lahare22-Dec-09 18:16
Abhi Lahare22-Dec-09 18:16 
Question[Message Deleted] Pin
transoft22-Dec-09 5:45
transoft22-Dec-09 5:45 
AnswerRe: .NET and COM PinPopular
Rajesh R Subramanian22-Dec-09 6:00
professionalRajesh R Subramanian22-Dec-09 6:00 
General[Message Deleted] Pin
transoft22-Dec-09 6:40
transoft22-Dec-09 6:40 
GeneralRe: .NET and COM Pin
Rajesh R Subramanian22-Dec-09 6:50
professionalRajesh R Subramanian22-Dec-09 6:50 
GeneralRe: .NET and COM Pin
Maximilien22-Dec-09 7:42
Maximilien22-Dec-09 7:42 
GeneralRe: .NET and COM PinPopular
Rajesh R Subramanian22-Dec-09 7:46
professionalRajesh R Subramanian22-Dec-09 7:46 
QuestionLife span of a Object???? Pin
ForNow22-Dec-09 4:29
ForNow22-Dec-09 4:29 
AnswerRe: Life span of a Object???? Pin
Maximilien22-Dec-09 4:37
Maximilien22-Dec-09 4:37 
GeneralRe: Life span of a Object???? Pin
ForNow22-Dec-09 5:44
ForNow22-Dec-09 5:44 
AnswerRe: Life span of a Object???? Pin
Rajesh R Subramanian22-Dec-09 4:45
professionalRajesh R Subramanian22-Dec-09 4:45 
GeneralRe: Life span of a Object???? Pin
LunaticFringe22-Dec-09 5:27
LunaticFringe22-Dec-09 5:27 
GeneralRe: Life span of a Object???? Pin
Rajesh R Subramanian22-Dec-09 6:02
professionalRajesh R Subramanian22-Dec-09 6:02 
GeneralRe: Life span of a Object???? Pin
LunaticFringe22-Dec-09 6:14
LunaticFringe22-Dec-09 6:14 

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.