#ifndef ABSTRACTION_H #define ABSTRACTION_H /////////////////////////////////////////////////////////////////////// // Abstraction.h - Defines Abstraction interface and its Concrete // // derivatives (Abstraction, Refined Abstractions) // // // // Skeleton for the BRIDGE PATTERN // // Participants : Abstraction, Refined Abstractions, // // Implementor, Concrete implementors // // // // ver 1.0 // // Language: Visual C++, ver 6.0, // // Platform: Dell XPS1000r, Windows 2000 Professional // // Author: Jim Fawcett, CST 2-187, Syracuse Univ. // // Source: // // Ivan Bernal/Wang Xiaoqiang // // imbernal@syr.edu // // CSE791 - Design Patterns, Summer 2000 // /////////////////////////////////////////////////////////////////////// class Implementor; class Abstraction { public: enum eImpType { A, B}; //choose implementation Abstraction(eImpType impType); virtual void Operation()=0; virtual~ Abstraction(); protected: virtual Implementor* GetImplementor(); private: Implementor* _imp; }; class RefinedAbstraction1 : public Abstraction { public: RefinedAbstraction1(eImpType impTYpe); virtual ~RefinedAbstraction1(); virtual void Operation(); }; class RefinedAbstraction2 : public Abstraction { public: RefinedAbstraction2(eImpType impTYpe); virtual ~RefinedAbstraction2(); virtual void Operation(); }; #endif