// TriggerStopFlag.h: interface for the CTriggerStopFlag class.
//
//////////////////////////////////////////////////////////////////////
#pragma once

#include <string>

#include "Utility.h"
#include "TriggerWithInput.h"

#include "DllDefines.h"

class MCCTRDLLCLASS CTriggerStopFlag : public CTriggerWithInput
{
public:
    explicit CTriggerStopFlag(CEvt* m_evtMcStop);
    virtual ~CTriggerStopFlag();

    //  return true if evt signaled. return false if timeout or stop flag trigger
    bool Wait(CEvt& evt, DWORD dwTimeOut = INFINITE);

    DWORD Wait(DWORD dwTimeOut = INFINITE);

    //  DWORD CTriggerStopFlag::WaitEol(CEvt &evt, DWORD dwTimeOut = INFINITE);

    //  wait for stop flag or sleep for a predefined time
    static bool DebugSleep(std::string csDisplayString /* = ""*/, int iSleepTime /* = 3000*/,
        CEvt* evt /* = NULL*/);

private:
    CEvt* m_evtMcStop;
};
