diff options
Diffstat (limited to 'doc/sources/c++/polygon.h')
-rw-r--r-- | doc/sources/c++/polygon.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/sources/c++/polygon.h b/doc/sources/c++/polygon.h new file mode 100644 index 0000000..e3189bf --- /dev/null +++ b/doc/sources/c++/polygon.h @@ -0,0 +1,25 @@ +#ifndef POLYGON_HPP +#define POLYGON_HPP + +class polygon +{ + protected: + double side_length_; + + public: + polygon() : side_length_(0) + {} + + void set_side_length(double side_length) + { + side_length_ = side_length; + } + + virtual double area() const = 0; +}; + +// the types of the class factories +typedef polygon* create_t(); +typedef void destroy_t(polygon*); + +#endif |