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

Class for a program. More...

#include <program.h>

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

Public Member Functions

 Program (std::string, CourseType)
 Constructs the Program object. More...
 
bool operator== (const Program &other)
 Checks if two Program objects are identical, which is whether they have the same name and course type. More...
 
FieldType getType ()
 Gets the type under the FieldType enum. More...
 
std::string getName ()
 Gets the name of the Program. More...
 
bool isCoreProgram ()
 Determines if the Program has a Course as core. More...
 
std::string getTypeName ()
 Gets the type name, which is "Program". More...
 
std::string getCourseTypeName ()
 Gets the course type name as a string. More...
 
std::string getNameWithType ()
 Gets the name with type. The result is the program name, followed by a space, and followed by its type. More...
 

Detailed Description

Class for a program.

Definition at line 27 of file program.h.

Constructor & Destructor Documentation

◆ Program()

Program::Program ( std::string  name,
CourseType  courseType 
)

Constructs the Program object.

Parameters
[in]nameThe name of the Program, which uniquely identifies it. For example, it could be "B Tech 1".
[in]courseTypeThe course type, which could be core or elective

Definition at line 13 of file program.cpp.

Member Function Documentation

◆ getCourseTypeName()

std::string Program::getCourseTypeName ( )

Gets the course type name as a string.

Returns
The string "Core", if the type is core, and "Elective" if the type is elective

Definition at line 64 of file program.cpp.

References core.

Referenced by getNameWithType().

◆ getName()

std::string Program::getName ( )

Gets the name of the Program.

Returns
The name of the Program

Definition at line 42 of file program.cpp.

◆ getNameWithType()

std::string Program::getNameWithType ( )

Gets the name with type. The result is the program name, followed by a space, and followed by its type.

Returns
The name with type

Definition at line 77 of file program.cpp.

References getCourseTypeName().

◆ getType()

FieldType Program::getType ( )
virtual

Gets the type under the FieldType enum.

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

Implements Field.

Definition at line 35 of file program.cpp.

◆ getTypeName()

std::string Program::getTypeName ( )
virtual

Gets the type name, which is "Program".

Returns
The string "Program"

Implements Field.

Definition at line 56 of file program.cpp.

◆ isCoreProgram()

bool Program::isCoreProgram ( )

Determines if the Program has a Course as core.

Returns
True if core program, False otherwise.

Definition at line 49 of file program.cpp.

References core.

◆ operator==()

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

Checks if two Program objects are identical, which is whether they have the same name and course type.

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

Definition at line 26 of file program.cpp.


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