Hi,
I am working on a piece of OOP which needs to be ran entirely by classes, by that meaning the main function should only create the first class and the rest of the program ran by member functions of various classes. Part of this task requires me to keep encapsulation. So all varible members need to be private.
The problem with this is that I am trying to send infomation to other classes using call by reference. See the example below:
class MenuClass
{
public:
MenuClass();
};
class InputClass // Objects : DataIn and Filter
{
public:
void LoadState(SavedClass &Save, long SavedLength, bool type); // References "Save"
private:
};
class OutputClass // Objects : DataOut
{
public:
int ApplyFilter(InputClass &DataIn,InputClass &Filter); // References DataIn and Filter
private:
};
class SavedClass // Objects : Save
{
public:
void Save(InputClass &DataIn,InputClass &Filter) const; // References DataIn and Filter
private:
}
(Showing just the relevent code)
Now the problem here is that I get the errors:
error C2061: syntax error : identifier 'SavedClass'
error C2660: 'InputClass::LoadState' : function does not take 3 arguments
error C2511: 'void InputClass::LoadState(Saved &,long,bool)' : overloaded member function not found in 'InputClass'
Is there a better way of doing this?
Thanks,
Ben