///////////////////////////////////////////////////////////////////// // ObjectAdapter.cpp - Implementation of Skeleton Object Adapter // // // // Jim Fawcett, CSE776 - Design Patterns, Spring 2014 // ///////////////////////////////////////////////////////////////////// /* * Note that client has no binding to either TargetImpl or AdapteeImpl */ #include "ObjectAdapter.h" #include class client { public: void doClientOperation() { Target* TargetCollection[2]; TargetCollection[0] = Factory::create(0); // targetImple TargetCollection[1] = Factory::create(1); // objectAdapter // using TargetImple and AdapteeImpl polimorphically std::cout << "\n client using Target Pointrs returned by Factory:"; for (auto TargetPtr : TargetCollection) std::cout << TargetPtr->doTargetOperation(); } }; int main() { std::cout << "\n Demonstrating Skeleton Object Adapter"; std::cout << "\n =======================================\n"; client c; c.doClientOperation(); std::cout << "\n\n"; }