#ifndef SHAPE_H #define SHAPE_H #include #include // Some of our classnames are very common (like Exception). So we'd better // have a namespace namespace Shapes { // Exception class for this application. class Exception { public: Exception(const char* s = "" ) : msg(s){} Exception(std::string s = "" ) : msg(s){} std::string message () const { return msg; } private: std::string msg; }; // Dummy class to distinguish registration constructor from other constructors struct Registration { Registration(std::string name) : name(name){} std::string name; }; class ShapeRep; // Envelope class class Shape { public: Shape(); Shape(const Shape& e) ; Shape& operator= (const Shape& e); Shape(ShapeRep& r); ~Shape(); ShapeRep* operator->(); private: ShapeRep* Rep; }; std::list& PrototypeList(); } // namespace #endif