1#include "units/inherited.hpp"
2
3#include "unit.hpp"
4
5#include <memory>
6#include <string>
7
8InheritedUnit::InheritedUnit(const std::string &id, std::shared_ptr<IUnit> baseUnit)
9 : IUnit(id), //
10 childUnit_(std::move(baseUnit)) //
11{
12}
13
14std::optional<std::string> InheritedUnit::GetFailReason() const
15{
16 return childUnit_->GetFailReason();
17}
18
19std::vector<std::string> InheritedUnit::GetPartOf() const
20{
21 return childUnit_->GetPartOf();
22}
23
24std::vector<std::string> InheritedUnit::GetDependencies() const
25{
26 return childUnit_->GetDependencies();
27}
28
29const UnitStatus &InheritedUnit::GetStatus() const
30{
31 return childUnit_->GetStatus();
32}
33
34bool InheritedUnit::Stop()
35{
36 return childUnit_->Stop();
37}
38
39bool InheritedUnit::Start()
40{
41 return childUnit_->Start();
42}
43
44UnitType InheritedUnit::GetType() const
45{
46 return UnitType::Inherited;
47}
48
49std::string InheritedUnit::GetChildId() const
50{
51 return childUnit_->id;
52}
53
54std::string InheritedUnit::GetDescription() const
55{
56 return childUnit_->GetDescription();
57}
58
59void InheritedUnit::AddDependency(const std::string &depName)
60{
61 childUnit_->AddDependency(depName);
62}
63