summaryrefslogtreecommitdiffstats
path: root/doc/sources/c++/polygon.hpp
blob: e3189bfb4387555ea22207ba42be4491ba30d0bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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