S
Simon Elliott
I have two classes A and B which encasulate some functionality. (In the
real example they are data access.)
xx.hpp:
class A
{
private:
class AImpl;
AImpl* pimpl_;
public:
A();
~A(void);
};
class B
{
private:
class BImpl;
BImpl* Bimpl_;
public:
B();
~B(void);
};
xx.cpp
class A::AImpl
{
public:
Tfoo fooA;
};
class B::BImpl
{
public:
Tfoo fooB;
};
Unfortunately in xx.cpp I now require A::AImpl to access B::fooB. But
B:impl_ is private (and I want to keep it that way). I don't want
xx.hpp to need to know anything about Tfoo as xx.cpp might one day be
re-written for Tbar.
Thoughts?
real example they are data access.)
xx.hpp:
class A
{
private:
class AImpl;
AImpl* pimpl_;
public:
A();
~A(void);
};
class B
{
private:
class BImpl;
BImpl* Bimpl_;
public:
B();
~B(void);
};
xx.cpp
class A::AImpl
{
public:
Tfoo fooA;
};
class B::BImpl
{
public:
Tfoo fooB;
};
Unfortunately in xx.cpp I now require A::AImpl to access B::fooB. But
B:impl_ is private (and I want to keep it that way). I don't want
xx.hpp to need to know anything about Tfoo as xx.cpp might one day be
re-written for Tbar.
Thoughts?