Skip to content

Commit 67fd52d

Browse files
author
Sebastian Hahn
committed
Feature: Add Timer interface
* it has a start function and a timeout signal Ticket: #4
1 parent fbd9b0f commit 67fd52d

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/Intervaltimer/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@ qt_add_qml_module(Intervaltimer
3838
intervaltimer/PlanRunner.cpp
3939
intervaltimer/PlanToJson.h
4040
intervaltimer/PlanToJson.cpp
41+
intervaltimer/TimerBase.h
42+
intervaltimer/TimerBase.cpp
4143
)
4244

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include "TimerBase.h"
2+
3+
TimerBase::TimerBase(QObject* parent)
4+
: QObject{parent} {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma once
2+
3+
#include <QObject>
4+
#include <chrono>
5+
6+
class TimerBase : public QObject {
7+
Q_OBJECT
8+
public:
9+
explicit TimerBase(QObject* parent = nullptr);
10+
11+
virtual void start(std::chrono::milliseconds const&) = 0;
12+
signals:
13+
void timeout();
14+
};

0 commit comments

Comments
 (0)