#pragma once

#include <vector>

#include "MyWait.h"
#include "Evt.h"
#include "DllDefines.h"

class UTILITYDLL CTrigger : public CMyWait
{
public:
    CTrigger();
    virtual ~CTrigger();

    void InsertTrigger(CEvt* pEvt, BOOL bState);
    void InsertTrigger(HANDLE handle);
    //  void InsertInput(CInput* pInput, BOOL bState, DWORD dwDebounce, DWORD dwTimeout);
    DWORD Wait(DWORD dwTimeOut = INFINITE);
    bool WaitForAll(DWORD dwTimeOut = INFINITE);
    void Reset();

protected:
    std::vector<HANDLE> m_aHandle;

private:
    DWORD WaitFor(DWORD dwTimeOut, BOOL bWaitForAll);
};