mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 17:52:28 +00:00
33 lines
741 B
C++
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
|