rusefi/unit_tests/test-framework/global_execution_queue.h

33 lines
910 B
C
Raw Normal View History

/*
2019-04-15 16:24:46 -07:00
* @file global_execution_queue.h
*
* Created on: Jan 9, 2019
2020-01-07 21:02:40 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
*/
2020-04-01 18:32:21 -07:00
#pragma once
#include "scheduler.h"
#include "event_queue.h"
class TestExecutor : public ExecutorInterface {
public:
2020-07-31 14:41:29 -07:00
~TestExecutor();
void scheduleByTimestamp(const char *msg, scheduling_s *scheduling, efitimeus_t timeUs, action_s action) override;
void scheduleByTimestampNt(const char *msg, scheduling_s *scheduling, efitick_t timeNt, action_s action) override;
void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override;
void cancel(scheduling_s* scheduling) override;
void clear();
int executeAll(efitick_t now);
int size();
scheduling_s * getHead();
scheduling_s * getForUnitTest(int index);
void setMockExecutor(ExecutorInterface* exec);
private:
EventQueue schedulingQueue;
ExecutorInterface* m_mockExecutor = nullptr;
};