|
lab_memory
Malevolent Memories
|
Represents a testing room, which has a group of letters allocated to it (where letters are first letters of last names). More...
#include "room.h"
Collaboration diagram for Room:Public Member Functions | |
| Room () | |
| Room Default Constructor. More... | |
| Room (const Room &other) | |
| Room copy constructor. More... | |
| Room (const string &init_name, int init_capacity) | |
| Main Room constructor. More... | |
| Room & | operator= (const Room &other) |
| Room assignment operator. More... | |
| ~Room () | |
| Room destructor. More... | |
| void | addLetter (const Letter &L) |
| Allocates a letter group to this room. More... | |
| int | spaceRemaining () |
| void | print (std::ostream &stream=std::cout) |
| Outputs the room to cout. More... | |
Public Attributes | |
| string | name |
| The room name. More... | |
| int | capacity |
| The capacity of the room. More... | |
| int | count |
| The number of students currently allocated. More... | |
| int | max_letters |
| The maximum size of the letters array (26) More... | |
| Letter * | letters |
| An array of Letters currently allocated. More... | |
| int | letterCount |
| The number of valid Letters in the Letters array. More... | |
Private Member Functions | |
| void | clear () |
| Destructor/assignment operator clear helper function. More... | |
| void | copy (const Room &other) |
| Cctor/assignment operator copy helper function. More... | |
Represents a testing room, which has a group of letters allocated to it (where letters are first letters of last names).
| Room::Room | ( | ) |
Room Default Constructor.
Creates a blank (uninitialized) room
| Room::Room | ( | const Room & | other | ) |
| Room::Room | ( | const string & | init_name, |
| int | init_capacity | ||
| ) |
| Room::~Room | ( | ) |
Room destructor.
| void Room::addLetter | ( | const Letter & | L | ) |
Allocates a letter group to this room.
| L | The letter group to add |
| int Room::spaceRemaining | ( | ) |
| void Room::print | ( | std::ostream & | stream = std::cout | ) |
Outputs the room to cout.
| stream | The stream to print to |
|
private |
Destructor/assignment operator clear helper function.
|
private |
Cctor/assignment operator copy helper function.
| string Room::name |
The room name.
| int Room::capacity |
The capacity of the room.
| int Room::count |
The number of students currently allocated.
| int Room::max_letters |
The maximum size of the letters array (26)
| Letter* Room::letters |
An array of Letters currently allocated.
| int Room::letterCount |
The number of valid Letters in the Letters array.