So, I have a function setDataSource which is designed to take an address of an object as an argument and set up a pointer to it inside a class. I can't figure out how pass a pointed-to object to it.
I get compiler errors -- no matching function for call to 'setDataSource(combinedDataObject**)'
Here's the source for the setDataObject function, which is part of class basicTimerObject. combinedDataObject is derived from timeObject.
void basicTimerObject::setDataSource(timeObject * timeNow)
{
dataSource = timeNow; // timeObject *dataSource is a protected member of basicTimerObject
}
setDataSource doesn't expect to be passed a pointer, it expects to be passed the address of an object. I'm trying to get it to work with a pointer instead. The problem is that I've got various objects that expect to be passed a reference to the global data object, which they store internally as a pointer, and now I'm trying to use an object which has one of these objects inside of it, along with a reference to the global data object. I'm trying to initialize the member object with the pointer stored in the object which contains it, rather than by passing it the address directly with &data as it expects.
Sorry if I'm not explaining this well; I have problems with pointers. %)