-
Notifications
You must be signed in to change notification settings - Fork 0
/
scienceservice.h
46 lines (37 loc) · 1.44 KB
/
scienceservice.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
#ifndef SCIENCESERVICE_H
#define SCIENCESERVICE_H
#include "scientist.h"
#include "scientistrepository.h"
#include "computer.h"
#include "computerrepository.h"
#include "scientistcomputerconnections.h"
#include "scientistcomputerconnectionsrepository.h"
#include <list>
// Domain layer, services the presentation layer
class ScienceService {
public:
ScienceService();
~ScienceService();
//Scientists
void addScientist(Scientist scientist);
void removeScientist(std::string id);
std::list<Scientist> searchScientist(std::string searchTerm);
std::list<Scientist> getAllScientists();
std::list<Scientist> getScientistsOrderedBy(std::string col,std::string mod);
//Computers
void addComputer(Computer computer);
void removeComputer(std::string id);
std::list<Computer> searchComputer(std::string searchTerm);
std::list<Computer> getAllComputers();
std::list<Computer> getComputersOrderedBy(std::string col,std::string mod);
//Connections
std::list<Computer> getAllComputersByScientistId(std::string id);
std::list<Scientist> getAllScientistsByComputerId(std::string id);
bool addConnection(std::string sid, std::string cid);
bool removeConnection(std::string sid, std::string cid);
private:
ScientistRepository scientistRepository;
computerrepository computerRepository;
ScientistComputerConnectionsRepository scientistComputerConnectionsRepository;
};
#endif // SCIENCESERVICE_H