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.

Constructor & Destructor Documentation

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

Member Function Documentation

void Slot::addSlotElements ( SlotElement  slotElement)

Adds a slot element to the Slot.

Parameters
[in]slotElementThe slot element to be added.
std::string Slot::getName ( )

Gets the name of the Slot.

Returns
The name.
FieldType Slot::getType ( )
virtual

Gets the type under the FieldType enum.

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

Implements Field.

std::string Slot::getTypeName ( )
virtual

Gets the type name, which is "Slot".

Returns
The string "Slot"

Implements Field.

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.
bool Slot::isMinorSlot ( )

Determines if the Slot is a minor Slot.

Returns
True if minor slot, False otherwise.
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.
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

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