|
-
Aug 20th, 2001, 04:09 AM
#1
Thread Starter
transcendental analytic
No C++ Gurus around here?
I have a Window class and a Skin template. The Window will call a Skin instance but in it's operation the Skin needs to access some properties of the Window, my first thought was passing a set of pointers but the Skin template is complex enough for the implementation process to be annoying, especially as the Skin template is made as a tool to easily design any type of Skin. My second idea was having the Window inherit a class that the Skin could access, I had though to store all the pointer data in that class which wasn't my intention. The Window should be quite light. My third thought was a bit similar, but this time a Agent_type parameter is passed to the Skin template which the Window inherits to provide information to the Skin.
I'm not quite sure but if I pass the Window object as a Agent_type will it lose it's ability to access the Window's properties? I've heard about slicing, but not sure if this is the case. Is this idea useless?
I'm prefering not to use virtual functions for a common Agent base class, just for another bit of performance.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|