// TriggerStopFlag.h: interface for the CTriggerStopFlag class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TRIGGERSTOPFLAG_H__0CAF5261_3554_4ADA_8E37_51C76AD54F86__INCLUDED_)
#define AFX_TRIGGERSTOPFLAG_H__0CAF5261_3554_4ADA_8E37_51C76AD54F86__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

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

#ifdef  BUILD_MCCTRDLL
#define     MCCTRDLLCLASS   __declspec(dllexport)
#else
#define     MCCTRDLLCLASS   __declspec(dllimport)
#endif

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(CString csDisplayString /* = ""*/, int iSleepTime /* = 3000*/,
                           CEvt *evt /* = NULL*/);

private:
    CEvt *m_evtMcStop;
};

#endif // !defined(AFX_TRIGGERSTOPFLAG_H__0CAF5261_3554_4ADA_8E37_51C76AD54F86__INCLUDED_)
