-
Notifications
You must be signed in to change notification settings - Fork 0
/
Composite.h
45 lines (33 loc) · 1.06 KB
/
Composite.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
#ifndef COMPOSITE_H
#define COMPOSITE_H
#include <string>
#include <vector>
#include <typeinfo>
#include <memory>
#include "Component.h"
class Composite : public Component {
public:
Composite(const std::string & location);
void addComponent(std::shared_ptr<Component> toBeAdded) override;
void removeComponent() override;
void test() override;
void activate() override;
void deactivate() override;
void setChild(std::shared_ptr<Component> child);
void setLocation(std::string location);
void setParent(Component* parent) override;
void setId(int newId) override;
Component* getParent()override;
std::vector<std::shared_ptr<Component>> getChildren();
std::string getLocation();
void getInfo() override;
std::string getType() override;
int getId() override;
std::vector<std::shared_ptr<Component>> getAllChildren() override;
//bool operator==(Component & otherComponent) override;
private:
std::string location;
Component* parent;
std::vector<std::shared_ptr<Component>> children;
};
#endif