/// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="log">IEventLog</param>
        /// <param name="threadIndex">Thread index</param>
        /// <param name="callMonitor">IThreadMonitor</param>
        /// <param name="testingEngine">ITestingEngine</param>
        /// <param name="configuration">Configuration</param>
        public ThreadExecutionMonitorDispatcher(IEventLog log, int threadIndex,
                                                IThreadMonitor callMonitor, ITestingEngine testingEngine, Configuration configuration)
            : base(threadIndex)
        {
            SafeDebug.AssertNotNull(callMonitor, "callMonitor");

            this.ThreadIndex   = threadIndex;
            this.Configuration = configuration;

            this.ThreadTrace = new List <ThreadTrace>();
            this.DebugTrace  = new SafeList <string>();
            this.CallStack   = new SafeStack <Method>();

            this.IsDoHandlerCalled     = false;
            this.IsEntryActionCalled   = false;
            this.IsExitActionCalled    = false;
            this.IsAction              = false;
            this.RecordRW              = false;
            this.IsCreateMachineMethod = false;

            // Registers a callback to emit the thread trace. The callback
            // is invoked at the end of each testing iteration.
            testingEngine.RegisterPerIterationCallBack(EmitThreadTrace);
        }
 public void RegisterPerIterationCallBack(Action <int> callback)
 {
     m_engine.RegisterPerIterationCallBack(callback);
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="log">IEventLog</param>
        /// <param name="threadIndex">Thread index</param>
        /// <param name="callMonitor">IThreadMonitor</param>
        /// <param name="testingEngine">ITestingEngine</param>
        /// <param name="configuration">Configuration</param>
        public ThreadExecutionMonitorDispatcher(IEventLog log, int threadIndex,
            IThreadMonitor callMonitor, ITestingEngine testingEngine, Configuration configuration)
            : base(threadIndex)
        {
            SafeDebug.AssertNotNull(callMonitor, "callMonitor");

            this.ThreadIndex = threadIndex;
            this.Configuration = configuration;

            this.ThreadTrace = new List<ThreadTrace>();
            this.DebugTrace = new SafeList<string>();
            this.CallStack = new SafeStack<Method>();

            this.IsDoHandlerCalled = false;
            this.IsEntryActionCalled = false;
            this.IsExitActionCalled = false;
            this.IsAction = false;
            this.RecordRW = false;
            this.IsCreateMachineMethod = false;

            // Registers a callback to emit the thread trace. The callback
            // is invoked at the end of each testing iteration.
            testingEngine.RegisterPerIterationCallBack(EmitThreadTrace);
        }