Re: [Dev-C++] Virtual Functions and Command system
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Hossein H. <ult...@em...> - 2003-08-26 13:30:58
|
Dear David,
> class A {
> public:
> virtual void do_xxx(void)
> {
> //code
> }
> }
>
> class A_derivative : public A
> {
> void do_xxx(void)
> {
> //Some other code.
> }
> }
>
> Assume I have a object of type A_derivative.
>
> If I want the code for do_xxx to call do_xxx in class A first the only option I seem to have is add A::do_xxx() as the first line in A_derivative::do_xxx
Yep, I think.
> I have a command class which contains a string as the key and a function pointer as the data. I am being told about using "command objects" that would handle the actual execution of the command. Does anyone have any experience in this and if so could you give some example code or point me to a tutorial. The concept seems useful I am getting stuck when it comes to implementing it (Should I overload the () operator?)
The best tuterial which has got free-to-download code as well is
"Modern C++ Design."
The following is its complete bibliography:
Alexandrescu A., Modern C++ Design: Generic Programming and
Design Patterns Applied, Addison-Wesley, 2001,
ISBN: 0-201-70431-5.
Regards,
--Hossein
--
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|