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

Class for a course. More...

#include <course.h>

Public Member Functions

 Course (std::string, unsigned, int, int, MinorType)
 Constructs the Course object. More...
 
 Course (std::string, unsigned, int, int, MinorType, std::vector< int >)
 Constructs the Course object. More...
 
void setPrograms (std::vector< int >)
 Sets the programs for which the Course is applicable. More...
 
void addProgram (int)
 Adds a program that is applicable to the Course. More...
 
void addClassroom (int)
 Adds a classroom that is applicable to the Course. More...
 
void addSlot (int)
 Adds a slot that is applicable to the Course. More...
 
bool operator== (const Course &other)
 Checks if two Course objects are identical, i.e., if they represent the same Course. More...
 
std::string getName ()
 Gets the name of the Course. More...
 
int getInstructor ()
 Gets the instructor index of the Course. More...
 
std::vector< int > getPrograms ()
 Gets the indices of the programs of the Course. More...
 
int getSegment ()
 Gets the segment index of the Course. More...
 
MinorType getIsMinor ()
 Gets the 'is minor' index of the Course. More...
 
int getClassroom ()
 Gets the 'classroom' index of the Course. More...
 
int getSlot ()
 Gets the 'slot' index of the Course. More...
 
unsigned getClassSize ()
 Gets the class size of the Course. More...
 

Detailed Description

Class for a course.

Definition at line 16 of file course.h.

Constructor & Destructor Documentation

◆ Course() [1/2]

Course::Course ( std::string  name,
unsigned  classSize,
int  instructor,
int  segment,
MinorType  isMinor 
)

Constructs the Course object.

Parameters
[in]nameThe name of the course
[in]classSizeThe class size of the course
[in]instructorThe instructor index of the course
[in]segmentThe segment index of the course
[in]isMinorIndicates if the course is a minor course

Definition at line 19 of file course.cpp.

◆ Course() [2/2]

Course::Course ( std::string  name,
unsigned  classSize,
int  instructor,
int  segment,
MinorType  isMinor,
std::vector< int >  programs 
)

Constructs the Course object.

Parameters
[in]nameThe name of the course
[in]classSizeThe class size of the course
[in]instructorThe instructor index of the course
[in]segmentThe segment index of the course
[in]isMinorIndicates if the course is a minor course
[in]programsThe indices of the programs for which the course is applicable

Definition at line 39 of file course.cpp.

Member Function Documentation

◆ addClassroom()

void Course::addClassroom ( int  cr)

Adds a classroom that is applicable to the Course.

Parameters
[in]crThe index of the classroom to be added

Definition at line 71 of file course.cpp.

◆ addProgram()

void Course::addProgram ( int  programs)

Adds a program that is applicable to the Course.

Parameters
[in]programsThe index of the program to be added

Definition at line 64 of file course.cpp.

◆ addSlot()

void Course::addSlot ( int  s)

Adds a slot that is applicable to the Course.

Parameters
[in]sThe index of the slot to be added

Definition at line 78 of file course.cpp.

◆ getClassroom()

int Course::getClassroom ( )

Gets the 'classroom' index of the Course.

Returns
The classroom index in the list of Classrooms

Definition at line 132 of file course.cpp.

◆ getClassSize()

unsigned Course::getClassSize ( )

Gets the class size of the Course.

Returns
The class size.

Definition at line 146 of file course.cpp.

◆ getInstructor()

int Course::getInstructor ( )

Gets the instructor index of the Course.

Returns
The instructor index in the list of instructors

Definition at line 104 of file course.cpp.

◆ getIsMinor()

MinorType Course::getIsMinor ( )

Gets the 'is minor' index of the Course.

Returns
The isMinor index in the list of isMinors

Definition at line 125 of file course.cpp.

◆ getName()

std::string Course::getName ( )

Gets the name of the Course.

Returns
The name.of the Course

Definition at line 97 of file course.cpp.

◆ getPrograms()

std::vector< int > Course::getPrograms ( )

Gets the indices of the programs of the Course.

Returns
The indices of the programs in the list of programs

Definition at line 111 of file course.cpp.

◆ getSegment()

int Course::getSegment ( )

Gets the segment index of the Course.

Returns
The segment index in the list of segments

Definition at line 118 of file course.cpp.

◆ getSlot()

int Course::getSlot ( )

Gets the 'slot' index of the Course.

Returns
The slot index in the list of slots

Definition at line 139 of file course.cpp.

◆ operator==()

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

Checks if two Course objects are identical, i.e., if they represent the same Course.

Parameters
[in]otherThe Course with which the comparison is being made
Returns
true if identical, false otherwise

Definition at line 88 of file course.cpp.

◆ setPrograms()

void Course::setPrograms ( std::vector< int >  programs)

Sets the programs for which the Course is applicable.

Parameters
[in]programsThe indices of the programs for which the Course is applicable

Definition at line 55 of file course.cpp.


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