I am currently working on a project that has several files and is a little complicated (in terms of keeping the inheritance right). I am getting a compile error, and I think it has something to do with references. Here is the error I'm getting at compile time
videotodatastream.cpp: In member function ‘virtual void Wade::VideoToDataStream::getData(std::string&)’:
videotodatastream.cpp:33: error: no matching function for call to ‘Wade::VideoWrapper::getVideo(Letscher::Video (&)())’
videowrapper.h:10: note: candidates are: virtual void Wade::VideoWrapper::getVideo(Letscher::Video&)
Here is the line it is complaining about
Letscher::Video vid();
_vid.getVideo(vid); //Problem line
_vid is a private member data of type VideoWrapper&
VideoWrapper& _vid;
VideoWrapper is a pure virtual base class with the following methods:
class VideoWrapper {
public:
virtual void setVideo(Letscher::Video& video) = 0;
virtual void getVideo(Letscher::Video& video) = 0;
};
The child class of VideoWrapper that I am actually using is RawVideo and it looks like this
class RawVideo : public VideoWrapper {
public:
RawVideo(Letscher::Video& video);
virtual void setVideo(Letscher::Video& video);
virtual void getVideo(Letscher::Video& video);
private:
Letscher::Video* _vid;
};
Wade::RawVideo::RawVideo(Letscher::Video& video): _vid(&video) {
}
void Wade::RawVideo::setVideo(Letscher::Video& video) {
*_vid = video;
}
void Wade::RawVideo::getVideo(Letscher::Video& video) {
video = *_vid;
}
So when I call _vid.getVideo(vid), I want it to take the Video object vid, and set its value to the private data in RawVideo. But for some reason, the way I am calling this function does not match up with my code.
Any help would be great, thanks.