D
Dennis Lerche
Hi
I have a problem regarding cyclic dependency, yeahh I know bad
design. But right at this moment I can't see how it should be
redesigned to avoid this. The problem is that I just can't get it to
compile .....
I have two classes each having their own header files, including each
other. A forward decleration doesn't seem to be enough because they
also call function calls within the classes. How do I solve this ???
Example:
foo.h
-----
#include foo1.h
class foo{
public:
funcCalc(foo1 *temp);
anotherCall();
}
foo.cpp
-------
foo::funcCalc(foo1 *temp){
foo1->calcSomething(); //function call to the object foo1
}
foo::anotherCall(){}
foo1.h
-----
#include foo.h
class foo1{
public:
calcSomething();
anotherFunction();
}
foo1.cpp
-------
foo1::calcSomething(foo *temp){
}
foo1::anotherFunction(){
foo->anotherCall(); //function call to the object foo1
}
This is just a very simple example of the mess I'm dealing with. How
do I solve this ??
I have a problem regarding cyclic dependency, yeahh I know bad
design. But right at this moment I can't see how it should be
redesigned to avoid this. The problem is that I just can't get it to
compile .....
I have two classes each having their own header files, including each
other. A forward decleration doesn't seem to be enough because they
also call function calls within the classes. How do I solve this ???
Example:
foo.h
-----
#include foo1.h
class foo{
public:
funcCalc(foo1 *temp);
anotherCall();
}
foo.cpp
-------
foo::funcCalc(foo1 *temp){
foo1->calcSomething(); //function call to the object foo1
}
foo::anotherCall(){}
foo1.h
-----
#include foo.h
class foo1{
public:
calcSomething();
anotherFunction();
}
foo1.cpp
-------
foo1::calcSomething(foo *temp){
}
foo1::anotherFunction(){
foo->anotherCall(); //function call to the object foo1
}
This is just a very simple example of the mess I'm dealing with. How
do I solve this ??