In the project I'm working on, I have an outer class named "Camera", and inside this class I am tring to instantiate an object defined by a class named "Frame". The Frame class has this in it's private section:
private:
// No default ctor
Frame();
// No copy ctor
Frame( Frame& );
// No assignment operator
Frame& operator=( const Frame& );
So I get an error when I try to instantiate a frame object since the default constructors are private. In the public section of frame, however, there is this:
public:
Frame( char *pBuffer, int bufferSize );
So that is the constructor I need to call when instantiating Frame from within Camera. Problem is I cannot seem to figure out how to do this. I had the same issue with the Camera class (where the default constructors were in the private section), but all I had to do to fix that was:
Camera::Camera():mCamera(whatever params here){
//constructor stuff here
}
in the implementation file. When I try to do this same thing for Frame inside of the Camera class, however, I get tons of errors.
So how do I go about calling a particular constructor of an object from inside another object's class?