using a virtual C++ function
using a virtual C++ function
- Subject: using a virtual C++ function
- From: Robert Palmer Jr <email@hidden>
- Date: Mon, 9 Jun 2003 16:48:35 -0400
I'm trying to learn Cocoa and Objective C (for about the 3rd or 4th
time). I've looked through the archives for an answer, but haven't
found one.
I have a C++ class with a virtual function that is expected to be
overridden.
class SensorFinder
{
public:
SensorFinder();
virtual ~SensorFinder();
void search();
virtual void sensorFound(char hwAddr[6]){};
}
When search() is called, it queries the network for sensors. For each
sensor found, search calls the sensorFound() function. This is an
interface to the searching core. To use this, your "real" app would
derive from SensorFinder and implement sensorFound() and do something
(build a table/NSMutableArray) with each sensor found.
Now, I want to USE this in a cocoa application. Unfortunately, I can't
derive an objective-C class from a C++ class. I want to create an
NSTableView dataSource object and use this SensorFinder class to
populate it. What is the best way to go about this???
Thanks,
-----------------------------
Robert G. Palmer, Jr.
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.