#pragma once

#include "ServiceBase.h"
#include <atomic>
#include <thread>

class ANSTSService : public CServiceBase
{
public:
    ANSTSService(PCWSTR serviceName,
        BOOL canStop = TRUE,
        BOOL canShutdown = TRUE,
        BOOL canPauseContinue = FALSE);
    virtual ~ANSTSService();

protected:
    void OnStart(DWORD argc, LPWSTR* argv) override;
    void OnStop() override;

private:
    void ServiceWorkerThread();

    std::atomic<bool> m_stopping{ false };
    HANDLE m_stoppedEvent = nullptr;
    std::thread m_workerThread;
};
