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

Class for a slot. More...

#include <slot.h>

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

Public Member Functions

 Slot (std::string, IsMinor, std::vector< SlotElement >)
 Constructs the Slot object. More...
 
bool operator== (const Slot &other)
 Checks if two Slot objects are identical, which is if they have the same name. More...
 
bool isIntersecting (Slot &other)
 Determines if two Slots are intersecting. More...
 
void addSlotElements (SlotElement)
 Adds a slot element to the Slot. More...
 
bool isMinorSlot ()
 Determines if the Slot is a minor Slot. More...
 
FieldType getType ()
 Gets the type under the FieldType enum. More...
 
std::string getTypeName ()
 Gets the type name, which is "Slot". More...
 
std::string getName ()
 Gets the name of the Slot. More...
 
bool isMorningSlot ()
 Determines if the Slot is a morning Slot. More...
 

Detailed Description

Class for a slot.

A slot is a collection of slot elements. A slot can be designated to be a minor slot, which means it is reserved for minor courses.

Definition at line 82 of file slot.h.

Constructor & Destructor Documentation

◆ Slot()

Slot::Slot ( std::string  name,
IsMinor  isMinor,
std::vector< SlotElement slotElements 
)

Constructs the Slot object.

Parameters
[in]nameThe name of the Slot
[in]isMinorIndicates if it is a minor Slot
[in]slotElementsThe slot elements in the Slot

Definition at line 180 of file slot.cpp.

Member Function Documentation

◆ addSlotElements()

void Slot::addSlotElements ( SlotElement  slotElement)

Adds a slot element to the Slot.

Parameters
[in]slotElementThe slot element to be added.

Definition at line 223 of file slot.cpp.

◆ getName()

std::string Slot::getName ( )

Gets the name of the Slot.

Returns
The name.

Definition at line 255 of file slot.cpp.

◆ getType()

FieldType Slot::getType ( )
virtual

Gets the type under the FieldType enum.

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

Implements Field.

Definition at line 232 of file slot.cpp.

◆ getTypeName()

std::string Slot::getTypeName ( )
virtual

Gets the type name, which is "Slot".

Returns
The string "Slot"

Implements Field.

Definition at line 248 of file slot.cpp.

◆ isIntersecting()

bool Slot::isIntersecting ( Slot other)

Determines if two Slots are intersecting.

Two Slots are said to be intersecting if there exists a pair of SlotElements, one from each Slot, such that the SlotElements are intersecting.

Parameters
otherThe Slot with which the comparison is being made
Returns
True if intersecting, False otherwise.

Definition at line 207 of file slot.cpp.

◆ isMinorSlot()

bool Slot::isMinorSlot ( )

Determines if the Slot is a minor Slot.

Returns
True if minor slot, False otherwise.

Definition at line 239 of file slot.cpp.

References IsMinor::getMinorType(), and isMinorCourse.

◆ isMorningSlot()

bool Slot::isMorningSlot ( )

Determines if the Slot is a morning Slot.

A Slot is said to be a morning Slot if all its SlotElements are morning SlotElements.

Returns
True if morning slot, False otherwise.

Definition at line 265 of file slot.cpp.

◆ operator==()

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

Checks if two Slot objects are identical, which is if they have the same name.

Parameters
[in]otherThe Slot object with which the comparison is being made
Returns
True if identical, False otherwise

Definition at line 195 of file slot.cpp.


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