-
Notifications
You must be signed in to change notification settings - Fork 0
/
Emergencycenter.h
46 lines (35 loc) · 1.28 KB
/
Emergencycenter.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 EMERGENCYCENTER_H
#define EMERGENCYCENTER_H
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <memory>
#include <random>
#include <cstring>
#include <string.h>
#include "Component.h"
#include "Sensor.h"
class Emergencycenter
{
public:
Emergencycenter();
~Emergencycenter();
void addComponent(std::shared_ptr<Component> addedTo, std::shared_ptr<Component> toBeAdded);
void test(Component* component);
void activate(Component* Component);
void deactivate(Component* Component);
void getInfo();
std::vector<std::shared_ptr<Sensor>> sortOnId(std::vector<std::shared_ptr<Component>> components);
std::vector<std::shared_ptr<Sensor>> sortOnType(std::vector<std::shared_ptr<Component>> components);
std::vector<std::shared_ptr<Sensor>> sortOnVendor(std::vector<std::shared_ptr<Component>> components);
void setMainComposite(std::shared_ptr<Component> mainComposite);
std::shared_ptr<Component> getMainComposite();
private:
std::shared_ptr<Component> mainComposite;
std::vector<int> ID;
std::vector<std::string> getAllVendors(std::vector<Component*> sensors);
int getFreeId ();
bool checkIfIdExists (int id);
};
#endif