1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
MyClass
{
public:
MyClass(SomeClass& a1, SomeClass& be) : a(a1), b(be) { }
void run() { myDoStuffA(); myDoStuffB(); myDoStuffC(); }
protected:
virtual void myDoStuffA() { doStuffA(a, b); }
virtual void myDoStuffB() { doStuffB(a, b); }
virtual void myDoStuffC() { doStuffC(a, b); }
private:
SomeClass & a, b;
};
MyModeClass : public MyClass
{
public:
MyModeClass(SomeClass& a1, SomeClass& be, SomeClass ga,
SomeClass& del, SomeClass& ep) :
MyClass(a1, be), c(ga), d(del), e(ep) { }
virtual void myDoStuffA() { MyClass::myDoStuffA();
doMoreStuffA(a, b, c, d, e); }
virtual void myDoStuffB() { MyClass::myDoStuffB();
doMoreStuffB(a, b, c, d, e); }
virtual void myDoStuffC() { MyClass::myDoStuffC();
doMoreStuffC(a, b, c, d, e); }
private:
SomeClass & c, d, e;
};
|