#ifndef ABSTRACT_H #define ABSTRACT_H /////////////////////////////////////////////////////////////////// // abstract.h - abstract interface for product classes // // // // Demonstrates use of abstract interface and a static factory // // method to isolate product classes from client code. // // // // Jim Fawcett, CSE687 - Object Oriented Design, Spring 2001 // /////////////////////////////////////////////////////////////////// #include #include struct productAbstraction { virtual ~productAbstraction(); virtual void hello() = 0; virtual std::string reply() = 0; virtual void request(const std::string &req) = 0; static productAbstraction* createProduct(); private: static productAbstraction *pPA; }; //----< destructor >--------------------------------------------------- // // needed so facade's destructor will be called, // since compiler generated destructor is not virtual // inline productAbstraction::~productAbstraction() { std::cout << "\n interface destructor called"; } #endif