-
Notifications
You must be signed in to change notification settings - Fork 4
/
Room.h
89 lines (76 loc) · 1.74 KB
/
Room.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/** Room class
*
* #include "Room.h" <BR>
* -llib
*
*/
#ifndef ROOM_H
#define ROOM_H
// SYSTEM INCLUDES
#include<iostream>
// Room class definition
class Room {
public:
// LIFECYCLE
/** Default + Overloaded constructor.
*/
Room(float = 0.0, float = 0.0);
// Use compiler-generated copy constructor, assignment, and destructor.
// Room(const Room&);
// Room& operator=(const Room&);
// ~Room();
// OPERATORS
/** Stream Insertion operator.
*
* @param os Standard Output Stream.
* @param from The value to be inserted to the output stream.
*
* @return A reference to the standard output stream.
*/
friend std::ostream& operator <<(std::ostream& os, const Room& from);
/** Stream Extraction operator.
*
* @param is Standard Intput Stream.
* @param to The value to be extracted from the input stream.
*
* @return A reference to the standard input stream.
*/
friend std::istream& operator >>(std::istream& is, Room& to);
/** Addition operator.
*
* @param addend Constant reference of the addend room to be added.
*
* @return Sum of areas of 2 rooms.
*/
float operator +(const Room& addend)const;
// OPERATIONS
/** Function that stores item in the Room
*
* @param void
*
* @return void
*/
void Store();
// ACCESS
// setters
void SetWidth(float = 0.0);
void SetLength(float = 0.0);
void SetRoom(float = 0.0, float = 0.0);
/**
# @overload void SetRoom(const Room& aRoom);
*/
void SetRoom(const Room& aRoom);
// getters
float GetWidth() const;
float GetLength() const;
float GetArea() const;
const Room& GetRoom()const;
private:
// DATA MEMBERS
float mWidth;
float mLength;
float mArea;
};
// end class Room
#endif
// _ROOM_H_