Files
wlan-cloud-owprov/src/FileDownloader.h
2023-02-21 13:34:41 -08:00

33 lines
741 B
C++

//
// Created by stephane bourque on 2022-03-11.
//
#pragma once
#include "Poco/Timer.h"
#include "framework/SubSystemServer.h"
namespace OpenWifi {
class FileDownloader : public SubSystemServer {
public:
static auto instance() {
static auto instance_ = new FileDownloader;
return instance_;
}
int Start() override;
void Stop() override;
void onTimer(Poco::Timer &timer);
private:
Poco::Timer Timer_;
std::unique_ptr<Poco::TimerCallback<FileDownloader>> TimerCallback_;
std::atomic_bool Running_ = false;
FileDownloader() noexcept
: SubSystemServer("FileDownloader", "FILE-DOWNLOADER", "downloader") {}
};
inline auto FileDownloader() { return FileDownloader::instance(); }
} // namespace OpenWifi