First Class
Student Class Reference

#include <student.h>

Public Member Functions

 Student ()
 Default constructor. More...
 
 Student (const std::string &fname, const std::string &matrikel, const int studium)
 Parameter constructor. More...
 
 Student (const std::string &fname, const std::string &matrikel, const std::vector< int > &studium)
 Parameter constructor. More...
 
 Student (const Student &orig)=default
 
Studentoperator= (const Student &rhs)=default
 
 ~Student ()
 
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. More...
 
bool Enrolled4Study (const int cSKZ) const
 Checks whether a student is enrolled in study cSKZ. More...
 

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 10 of file student.h.

Constructor & Destructor Documentation

◆ Student() [1/4]

Student::Student ( )

Default constructor.

Definition at line 7 of file student.cpp.

◆ Student() [2/4]

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

Parameter constructor.

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

◆ Student() [3/4]

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

Parameter constructor.

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

◆ Student() [4/4]

Student::Student ( const Student orig)
default

◆ ~Student()

Student::~Student ( )
inline

Default destructor

Definition at line 45 of file student.h.

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 29 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 36 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 131 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 88 of file student.h.

◆ Getmatr_nr()

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

Access matr_nr

Returns
The current value of matr_nr
matricel number

Definition at line 67 of file student.h.

◆ Getname()

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

Definition at line 51 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 96 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 120 of file student.h.

◆ operator=()

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

◆ Setname()

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

Assigns a new name to the student

Parameters
[in]valNew name to set

Definition at line 27 of file student.cpp.

Friends And Related Function 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: