//
// Created by WJG on 2021-9-15.
//

#ifndef SMARTPANEL_COSS_DAEMONWORKER_H
#define SMARTPANEL_COSS_DAEMONWORKER_H

#include <unordered_set>
#include "../MsgSchedule/CThread.h"

class DaemonWorker : public CThread{
public:
    explicit DaemonWorker(std::unordered_set<std::string>);
//    explicit DaemonWorker(int t);
    void Run() override ;
    void setDelayTime(int t_second);
    void setNumber(int all, int num);
    void setStop(bool set_v);
    void resetCounter();
    void setSuccessDevices(std::string did);

private:
    unsigned int counter;
    int delay_time;
    int total;
    int number;
    bool is_stoping;
    std::unordered_set<std::string> all_devices;
    std::unordered_set<std::string> success_devices;

    void sendEndMsg();
};

#endif //SMARTPANEL_COSS_DAEMONWORKER_H
