move construction of Hardware sim components

to member init list
This commit is contained in:
Matthew Colvin 2023-08-27 20:30:00 -05:00 committed by MatthewColvin
parent 65162049b3
commit 23fedd8052

View file

@ -14,13 +14,11 @@ HardwareSimulator::HardwareSimulator(): HardwareAbstract(),
while(true){ while(true){
std::this_thread::sleep_for(std::chrono::milliseconds(2)); std::this_thread::sleep_for(std::chrono::milliseconds(2));
lv_tick_inc(2); /*Tell lvgl that 2 milliseconds were elapsed*/ lv_tick_inc(2); /*Tell lvgl that 2 milliseconds were elapsed*/
}}) }}),
{ mBattery(std::make_shared<BatterySimulator>()),
mBattery = std::make_shared<BatterySimulator>(); mDisplay(SDLDisplay::getInstance()),
mDisplay = SDLDisplay::getInstance(); mWifiHandler(std::make_shared<wifiHandlerSim>())
mWifiHandler = std::make_shared<wifiHandlerSim>(); {}
}
std::shared_ptr<BatteryInterface> HardwareSimulator::battery(){ std::shared_ptr<BatteryInterface> HardwareSimulator::battery(){
return mBattery; return mBattery;