I have a class, suppose a.cpp . In private ownership of this class, I have a pointer to b.cpp and c.cpp , where b.cpp is the implementation of the virtual interface class, which allows you to call d.cpp . Also, in private ownership of c.cpp , I have a pointer to an interface class, d.cpp .
I want to access one of the methods of the a.cpp class in the b.cpp class. How can i do this?
The example may be ok, let me give some methods in classes
class A{ private: B *_classB; C *_classC; public: int add(int, int); }
Now the class of the interface D So, in the class D we have
class D{ public: virtual int mul(int, int) = 0; }
Now class B is an implementation of the interface class D So, B looks like this:
class B{ private: int first_num; int second_num; public: virtual int mul(int a, int b); }
and class C also has a pointer to an interface class, so C looks like
class C{ private: D *_classD; }
Now I want to call the int add (int, int) method in class B.