/////////////////////////////////////////////////////////////////////// // client.cpp - test the skeleton for the bridge pattern // // // // Skeleton for the BRIDGE PATTERN // // Participants:Abstraction, Refined Abstractions, // // Implementor, Concrete implementor // // // // 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 // /////////////////////////////////////////////////////////////////////// #include "Abstraction.h" #include using namespace std; int main( void ) { cout << "\n Demonstrating Bridge Pattern" << "\n ==============================\n"; cout << "\n client creating RefinedAbstraction1A and RefinedAbstraction1B"; Abstraction* aRefinedAbstraction1A = new RefinedAbstraction1(Abstraction::A); Abstraction* aRefinedAbstraction1B = new RefinedAbstraction1(Abstraction::B); cout << "\n client using RefinedAbstractions 1A and 1B:"; aRefinedAbstraction1A->Operation(); aRefinedAbstraction1B->Operation(); cout << endl; cout << "\n client creating RefinedAbstraction2A and RefinedAbstraction2B"; Abstraction* aRefinedAbstraction2A = new RefinedAbstraction2(Abstraction::A); Abstraction* aRefinedAbstraction2B = new RefinedAbstraction2(Abstraction::B); cout << "\n client using RefinedAbstractions 1A and 1B:"; aRefinedAbstraction2A->Operation(); aRefinedAbstraction2B->Operation(); delete aRefinedAbstraction1A; delete aRefinedAbstraction1B; delete aRefinedAbstraction2A; delete aRefinedAbstraction2B; cout << "\n\n"; return 0; }