-
Notifications
You must be signed in to change notification settings - Fork 0
/
scienceservice.cpp
73 lines (57 loc) · 1.88 KB
/
scienceservice.cpp
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "scienceservice.h"
ScienceService::ScienceService() {
scientistRepository = ScientistRepository();
}
ScienceService::~ScienceService() {
}
void ScienceService::addScientist(Scientist scientist) {
scientistRepository.add(scientist);
}
void ScienceService::removeScientist(std::string id) {
scientistRepository.remove(id);
}
std::list<Scientist> ScienceService::getAllScientists() {
return scientistRepository.list();
}
std::list<Scientist> ScienceService::getScientistsOrderedBy(std::string col, std::string mod) {
return scientistRepository.list(col,mod);
}
std::list<Scientist> ScienceService::searchScientist(std::string searchTerm) {
return scientistRepository.search(searchTerm);
}
void ScienceService::addComputer(Computer computer)
{
computerRepository.add(computer);
}
void ScienceService::removeComputer(std::string id)
{
computerRepository.remove(id);
}
std::list<Computer> ScienceService::searchComputer(std::string searchTerm)
{
return computerRepository.search(searchTerm);
}
std::list<Computer> ScienceService::getAllComputers()
{
return computerRepository.list();
}
std::list<Computer> ScienceService::getComputersOrderedBy(std::string col, std::string mod)
{
return computerRepository.list(col, mod);
}
std::list<Computer> ScienceService::getAllComputersByScientistId(std::string id)
{
return scientistComputerConnectionsRepository.getAllComputersByScientistId(id);
}
std::list<Scientist> ScienceService::getAllScientistsByComputerId(std::string id)
{
return scientistComputerConnectionsRepository.getAllScientistsByComputerId(id);
}
bool ScienceService::addConnection(std::string sid, std::string cid)
{
return scientistComputerConnectionsRepository.addConnection(sid, cid);
}
bool ScienceService::removeConnection(std::string sid, std::string cid)
{
return scientistComputerConnectionsRepository.removeConnection(sid, cid);
}