Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > Re: How to hand...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 21 Topic 1085 of 1118
Post > Topic >>

Re: How to handle this OOP/inheritance problem?

by "Jason Burgon" <jaynews@[EMAIL PROTECTED] > Feb 10, 2008 at 11:56 AM

"Jim Leonard" <MobyGamer@[EMAIL PROTECTED]
> wrote in message
news:4e25725a-3fd4-4523-bc02-87a9e720485e@[EMAIL PROTECTED]
> But my question is:  How can I initialize my TPlayer object to call
> the right output device object?  Is the proper way to pass the pointer
> to the output device object to TPlayer during TPlayer's
> initialization?

You could use a registry of TOutputDevices that the TPlayer uses to obtain
the correct one, based on the file-extension of the song data, or the
TPlayer's own type - rather like one might obtain the correct bitmapped
image handler from the file-extension (*.bmp, *.jpg, etc). This would be a
one-time operation for each TPlayer and outside the "Play" loop, so does
not
need to be ultra-fast.

>  If so, what would the pointer type be?  Would it be
> the TOutputDevice abstract/ancestor's type, or the descendant's type?

You define an abstract TOutputDevice for two reasons:

(1) As a basis for creating non-abstract devices.
(2) As a means to define the interface to all TOutputDevice types.

So the device is passed as the abstract TOutputDevice type, but it will in
reality ALWAYS be a non-abstract descendant, because abstract objects are
never instantiated.

function TDeviceRegistry.GetDeviceFor(X: TSomeSpecifier): TOutputDevice;

> If my target platform were something other than an 8088, I would
> virtualize everything to within an inch of its life :-) but instead I
> have to balance form with function.

Virtualization doesn't have to cost you very much time at all - if you get
the design right.

-- 
Jay

Jason Burgon - author of Graphic Vision
http://homepage.ntlworld.com/gvision
 




 21 Posts in Topic:
How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-04 17:18:17 
Re: How to handle this OOP/inheritance problem?
"Jason Burgon"   2008-02-05 19:17:21 
Re: How to handle this OOP/inheritance problem?
Femme Verbeek <fv2006@  2008-02-05 22:01:32 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-06 09:50:02 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-06 12:07:29 
Re: How to handle this OOP/inheritance problem?
Femme Verbeek <fv2006@  2008-02-07 02:02:07 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-06 21:04:50 
Re: How to handle this OOP/inheritance problem?
dik <quagga5@[EMAIL PR  2008-02-07 05:10:52 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-07 07:39:09 
Re: How to handle this OOP/inheritance problem?
dik <quagga5@[EMAIL PR  2008-02-07 11:01:54 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-08 08:49:39 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-09 19:45:14 
Re: How to handle this OOP/inheritance problem?
Marco van de Voort <ma  2008-02-10 11:31:10 
Re: How to handle this OOP/inheritance problem?
"Jason Burgon"   2008-02-10 11:56:57 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-10 10:42:20 
Re: How to handle this OOP/inheritance problem?
"Jason Burgon"   2008-02-11 01:54:58 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-10 21:31:25 
Re: How to handle this OOP/inheritance problem?
"Jason Burgon"   2008-02-11 12:04:54 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-11 09:06:30 
Re: How to handle this OOP/inheritance problem?
"Jason Burgon"   2008-02-11 20:37:17 
Re: How to handle this OOP/inheritance problem?
Jim Leonard <MobyGamer  2008-02-11 13:41:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 15:55:22 CDT 2008.