本文共 1274 字,大约阅读时间需要 4 分钟。
class IComm {public: virtual void Connect() = 0; virtual void Listen() = 0; virtual void Receive() = 0; virtual void Send() = 0;};
class SComm : public IComm{ ......};class SMessage : public IComm{ ......};class SConnect : public IComm{ ......};
class Client { void SetCommHandler(IComm* comm); voidReceive() { comm->Receive();} void Send() { comm->send();}};
class IConnect {public: virtual void Connect() = 0; virtual void Listen() = 0;};class IComm { virtual void Receive() = 0; virtual void Send() = 0;};
class SComm : public IComm, IConnect { ......};class SMessage : public IComm{ ......};class SConnect : public IConnect{ ......};
转载地址:http://odeqj.baihongyu.com/