Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: helper class instance creation



OSObject doesn't come with that much overhead. It implements a reference counting mechanism and that is about it.

However that isn't really the issue. You will need to implement at least one object that IS an IOService subclass otherwise your drivers wont match. Since multiple inheritance is not allowed it means that your abstract class will probably need to inherit from IOService. Fortunately this is exactly the model that Families provide and you can use our Family infrastructure to help you, It may even be possible to deliver your project as three kexts, a family and 2 driver kexts.

Finally if you don't inherit from OSObject (or IOService) then you can use 'new' or even just create static or automatic classes. Remember thought that you will have significant binary compatibility issues if you split your code into multiple kexts.

Check out IOKit's use of

OSDeclareAbstractStructors() & OSDefineMetaClassAndAbstractStructors()

Godfrey

On 06/02/2005, at 12:41 , Parav Pandit wrote:

Hi,

 have one abstact class which represent my HBA card.
and 2 other classes derived from this abstract class.
Each one for different HBA.

This is not a driver class. It is just helper class.

This absract class is NOT derived any IOService or
OSObject or any other OS classes.

But I need the inheritance capability.

My question is :
How to create an instace of this independent class?

Can I use the "new" operator?

Or should I derive from OSObject?
But I don't want that big overhead for small
functionalies.

Or something else?

Regards,
Parav




__________________________________________________________
How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-drivers mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden
References: 
 >helper class instance creation (From: Parav Pandit <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.