21 lines
450 B
C++

#include "SmartHome.h"
SmartHome::SmartHome(std::string name) : name(name){}
SmartHome::~SmartHome(){
for (Device* device: devices) {
delete device;
}
}
std::string SmartHome::toString() const {
std::string str;
str = "House name: " + name + "\n";
for (auto device : devices) str += device->toString();
return str;
}
void SmartHome::addDevice(Device *device) {
devices.push_back(device);
}