First Class
Loading...
Searching...
No Matches
Student Class Reference

#include <student.h>

Public Member Functions

 Student ()
 Default constructor.
 
 Student (const std::string &fname, const std::string &matrikel, const int studium)
 Parameter constructor.
 
 Student (const std::string &fname, const std::string &matrikel, const std::vector< int > &studium)
 Parameter constructor.
 
 Student (const Student &orig)=default
 
Studentoperator= (const Student &rhs)=default
 
 ~Student ()=default
 
std::string Getname () const
 
void Setname (const std::string &val)
 
std::string Getmatr_nr () const
 
void Add_SKZ (const int skz_in)
 
void Del_SKZ (const int skz_in)
 
const std::vector< int > & Get_SKZ () const
 
int Num_SKZ () const
 
bool operator< (const Student &rhs) const
 Compares two students wrt. the lexicographical ordering of names.
 
bool Enrolled4Study (const int cSKZ) const
 Checks whether a student is enrolled in study cSKZ.
 

Friends

std::ostream & operator<< (std::ostream &s, const Student &rhs)
 
std::istream & operator>> (std::istream &s, Student &rhs)
 

Detailed Description

Class student that contains the family name, matricel number and the enrolled studies.

Definition at line 9 of file student.h.

Constructor & Destructor Documentation

◆ Student() [1/4]

Student::Student ( )
inline

Default constructor.

Definition at line 14 of file student.h.

◆ Student() [2/4]

Student::Student ( const std::string &  fname,
const std::string &  matrikel,
const int  studium 
)
inline

Parameter constructor.

Parameters
[in]fnamefamily name
[in]matrikelmatricel number
[in]studiumone study

Definition at line 24 of file student.h.

◆ Student() [3/4]

Student::Student ( const std::string &  fname,
const std::string &  matrikel,
const std::vector< int > &  studium 
)
inline

Parameter constructor.

Parameters
[in]fnamefamily name
[in]matrikelmatricel number
[in]studiumvector of studies

Definition at line 34 of file student.h.

◆ Student() [4/4]

Student::Student ( const Student orig)
default

◆ ~Student()

Student::~Student ( )
default

Member Function Documentation

◆ Add_SKZ()

void Student::Add_SKZ ( const int  skz_in)

Fuegt eine Studienkennzahl (SKZ) hinzu.

Parameters
[in]skz_inzusaetzliche SKZ
Warning
Es wird nicht ueberprueft, ob diese SKZ bereits gespeichert ist. Dies wuerde ein find oder ein unique erfordern.

Definition at line 8 of file student.cpp.

Here is the caller graph for this function:

◆ Del_SKZ()

void Student::Del_SKZ ( const int  skz_in)

Enfernt eine Studienkennzahl (SKZ).

Parameters
[in]skz_inzu entfernende SKZ
Warning
Es wird nicht ueberprueft, ob diese SKZ mehrfach gespeichert ist.

Definition at line 15 of file student.cpp.

◆ Enrolled4Study()

bool Student::Enrolled4Study ( const int  cSKZ) const
inline

Checks whether a student is enrolled in study cSKZ.

Parameters
[in]cSKZstudy under search
Returns
found? (true/false)

Definition at line 124 of file student.h.

Here is the caller graph for this function:

◆ Get_SKZ()

const std::vector< int > & Student::Get_SKZ ( ) const
inline

Accesses the vector of studies

Returns
vector of studies

Definition at line 81 of file student.h.

◆ Getmatr_nr()

std::string Student::Getmatr_nr ( ) const
inline

Access matr_nr

Returns
The current value of matr_nr

Definition at line 60 of file student.h.

◆ Getname()

std::string Student::Getname ( ) const
inline
Returns
name of student

Definition at line 48 of file student.h.

◆ Num_SKZ()

int Student::Num_SKZ ( ) const
inline

Determines number of studies for this student

Returns
number of studies

Definition at line 89 of file student.h.

Here is the caller graph for this function:

◆ operator<()

bool Student::operator< ( const Student rhs) const
inline

Compares two students wrt. the lexicographical ordering of names.

Parameters
[in]rhsstudent to compare with
Returns
name(*this) < name(rhs)

Definition at line 113 of file student.h.

◆ operator=()

Student & Student::operator= ( const Student rhs)
default

◆ Setname()

void Student::Setname ( const std::string &  val)
inline

Assigns a new name to the student

Parameters
[in]valNew name to set

Definition at line 54 of file student.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const Student rhs 
)
friend

Ausgabeoperator fuer die Klasse.

Parameters
[in]sein beliebiger Ausgabestrom
[in]rhsdie auszugebende Instanz

◆ operator>>

std::istream & operator>> ( std::istream &  s,
Student rhs 
)
friend

Eingabeoperator fuer die Klasse.

Parameters
[in]sein beliebiger Eingabestrom
[in]rhsdie einzugebende Instanz
Warning
Hier wird nur eine SKZ eingegeben.

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