#ifndef OverbyteIcsServiceTcp1H
#define OverbyteIcsServiceTcp1H

#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Vcl.SvcMgr.hpp>

#include "OverbyteIcsServiceCmd.h"
#include "OverbyteIcsUtils.hpp"
#include "OverbyteIcsTypes.hpp"

#include <memory>

class TIcsTcpServce : public TService
{
__published:
    void __fastcall ServiceExecute(TService *Sender);
    void __fastcall ServiceStop(TService *Sender, bool &Stopped);
    void __fastcall ServiceCreate(TObject *Sender);
    void __fastcall ServiceDestroy(TObject *Sender);
    void __fastcall ServiceStart(TService *Sender, bool &Started);

private:
    std::unique_ptr<TTcpDaemon> FTcpDaemon;

    void __fastcall Display(const String &Msg);

public:
    __fastcall TIcsTcpServce(TComponent *Owner);
    TServiceController __fastcall GetServiceController(void);
    friend void __stdcall ServiceController(DWORD CtrlCode);
};

extern PACKAGE TIcsTcpServce *IcsTcpServce;

#endif
