point.h
1 #ifndef POINT_H_
2 #define POINT_H_
3 
4 #include <iostream>
5 
12 class Point
13 {
14  private:
15 
17  int x;
19  int y;
20 
21  public:
22 
28  Point();
29 
36  Point(int newx,int newy);
37 
45  int getX() const;
46 
54  int getY() const;
55 
63  void setX(int newx);
64 
72  void setY(int newy);
73 
89  friend Point operator+(const Point &a,const Point &b);
90 
107  friend Point operator+(const Point &a,const int &b);
108 
126  friend std::ostream& operator<<(std::ostream& out,const Point &pt);
127 
146  friend std::istream& operator>>(std::istream& in, Point &pt);
147 
162  friend bool operator==(const Point &a,const Point &b);
163 
178  friend bool operator!=(const Point &a,const Point &b);
179 
194  friend Point operator-(const Point &a);
195 
210  Point& operator=(const Point &other);
211 
226  void operator+=(const Point &right);
227 };
228 
229 #endif
int getX() const
Definition: point.cpp:20
friend bool operator!=(const Point &a, const Point &b)
Definition: point.cpp:83
int getY() const
Definition: point.cpp:26
void operator+=(const Point &right)
Definition: point.cpp:44
friend Point operator+(const Point &a, const Point &b)
Definition: point.cpp:106
void setY(int newy)
Definition: point.cpp:38
friend Point operator-(const Point &a)
Definition: point.cpp:68
friend std::ostream & operator<<(std::ostream &out, const Point &pt)
friend bool operator==(const Point &a, const Point &b)
Definition: point.cpp:77
Point()
Definition: point.cpp:6
Point & operator=(const Point &other)
Definition: point.cpp:51
friend std::istream & operator>>(std::istream &in, Point &pt)
void setX(int newx)
Definition: point.cpp:32
Definition: point.h:12