mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
21 lines
371 B
C++
21 lines
371 B
C++
|
|
#include "Station.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
Station::Station(int id) : id(id)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Station::addDevice(int deviceId, std::shared_ptr<Device> device)
|
|||
|
|
{
|
|||
|
|
mapDevice_[deviceId] = device;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
std::shared_ptr<Device> Station::getDevice(int deviceId)
|
|||
|
|
{
|
|||
|
|
auto iter = mapDevice_.find(deviceId);
|
|||
|
|
if (iter!=mapDevice_.end())
|
|||
|
|
{
|
|||
|
|
return iter->second;
|
|||
|
|
}
|
|||
|
|
return nullptr;
|
|||
|
|
}
|