设计模式之 抽象工厂模式

 

class IGateWayFactory
{
public:
    virtual ~IGateWayFactory(void){}
    virtual Device* CreateDevice(void) = 0;
    virtual IVRChannel* CreateIVRChannel(void) = 0;
}

class A: public IGateWayFactory
{
public:
    A(void);
    ~A(void);
public:
    virtual Device* CreateDevice(void);
    virtual IVRChannel* CreateIVRChannel(void);
private:
    Device* pDevice_;
    IVRChannel* pChannel_;
};

class B: public IGateWayFactory
{
public:
    B(void);
    ~B(void);
public:
    virtual Device* CreateDevice(void);
    virtual IVRChannel* CreateIVRChannel(void);
private:
    Device* pDevice_;
    IVRChannel* pChannel_;
};

 

posted on 2015-07-30 18:42  霏霏暮雨  阅读(184)  评论(0编辑  收藏  举报

导航