24,854
社区成员
发帖
与我相关
我的任务
分享
//handle.h
class Handle
{
public:
Handle();
~Handle();
void DoThis();
void DoThat();
private:
class HandleImpl;
HandleImpl* mpImpl;
};
// handle.cpp
class Handle::HandleImpl
{
public:
void DoThis ()
{
DoThisStep1();
DoThisStep2();
}
void DoThat()
{
DoThatStep();
}
private:
void DoThisStep1() {}
void DoThisStep2() {}
void DoThatStep()
{
DoThis();
}
};
Handle::Handle()
{
mpImpl = new HandleImpl;
}
Handle::~Handle()
{
delete mpImpl;
}
void Handle::DoThis()
{
mpImpl->DoThis();
}
void Handle::DoThat()
{
mpImpl->DoThat();
}