-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatkul.h
48 lines (33 loc) · 1.3 KB
/
matkul.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef MATKUL_HPP
#define MATKUL_HPP
#include <bits/stdc++.h>
#include "include/global.h"
class Kelas;
class Matkul {
private:
std::string id;
float sks;
std::set<Kelas*, std::less<>> recKelas;
public:
Matkul(const std::string& id, float sks) : id(id), sks(sks) { }
void setId(const std::string& aId) {id = aId;}
const std::string& getId() const {return id;}
void setSKS(float sks) {this->sks = sks;}
float getSKS() const {return this->sks;}
bool addKelas(Kelas& rKelas);
bool removeKelas(Kelas& rKelas);
std::set<Kelas*, std::less<>>& getRecKelas() const {
return (std::set<Kelas*, std::less<>>&) recKelas;
}
bool operator==(Matkul& other) { return this->id == other.getId(); }
bool operator>(Matkul& other) { return this->id > other.getId(); }
bool operator<(Matkul& other) { return this->id < other.getId(); }
bool operator>(const std::string& other) { return this->id > other; }
bool operator<(const std::string& other) { return this->id < other; }
~Matkul();
};
bool operator < (const Matkul& a, const Matkul& b);
std::ostream& operator << (std::ostream& os, const Matkul& mkl);
bool operator < (const Matkul& a, const std::string& b);
bool operator < (const std::string& a, const Matkul& b);
#endif // MATKUL_HPP