Timetabler
Public Member Functions | List of all members
Classroom Class Reference

Class for a classroom. More...

#include <classroom.h>

Inheritance diagram for Classroom:
Inheritance graph
[legend]
Collaboration diagram for Classroom:
Collaboration graph
[legend]

Public Member Functions

 Classroom (std::string, unsigned)
 Constructs the object. More...
 
bool operator== (const Classroom &other)
 Overloads the == operator to check for equality. More...
 
bool sizeLessThan (const Classroom &other)
 Checks if the size of this Classroom is less than the size of another. More...
 
FieldType getType ()
 Gets the type under the FieldType enum. More...
 
std::string getTypeName ()
 Gets the type name, which is "Classroom". More...
 
std::string getName ()
 Gets the class number of the Classroom. More...
 
unsigned getSize ()
 Gets the size of the Classroom. More...
 

Detailed Description

Class for a classroom.

Definition at line 13 of file classroom.h.

Constructor & Destructor Documentation

◆ Classroom()

Classroom::Classroom ( std::string  number,
unsigned  size 
)

Constructs the object.

Parameters
[in]numberThe Classroom number, a unique identifier
[in]sizeThe number of students the Classroom can hold

Definition at line 12 of file classroom.cpp.

Member Function Documentation

◆ getName()

std::string Classroom::getName ( )

Gets the class number of the Classroom.

Returns
The class number, which is unique identifier of the Classroom

Definition at line 61 of file classroom.cpp.

◆ getSize()

unsigned Classroom::getSize ( )

Gets the size of the Classroom.

Returns
The size of the Classroom

Definition at line 68 of file classroom.cpp.

◆ getType()

FieldType Classroom::getType ( )
virtual

Gets the type under the FieldType enum.

Returns
A member of the FieldType enum, which is FieldType::classroom

Implements Field.

Definition at line 47 of file classroom.cpp.

◆ getTypeName()

std::string Classroom::getTypeName ( )
virtual

Gets the type name, which is "Classroom".

Returns
The string "Classroom"

Implements Field.

Definition at line 54 of file classroom.cpp.

◆ operator==()

bool Classroom::operator== ( const Classroom other)

Overloads the == operator to check for equality.

Two classrooms are said to be equal if their numbers are identical.

Parameters
[in]otherThe Classroom with which the comparison is being done
Returns
Returns true if equal, false otherwise

Definition at line 26 of file classroom.cpp.

◆ sizeLessThan()

bool Classroom::sizeLessThan ( const Classroom other)

Checks if the size of this Classroom is less than the size of another.

Parameters
[in]otherThe Classroom with which the comparison is being done
Returns
Returns true if less, false othewise

Definition at line 38 of file classroom.cpp.


The documentation for this class was generated from the following files: