mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
2ea3643100
* Add and sort Network files to chatterino project file
36 lines
654 B
C++
36 lines
654 B
C++
#pragma once
|
|
|
|
#include <functional>
|
|
|
|
class QTimer;
|
|
|
|
namespace chatterino {
|
|
|
|
class NetworkWorker;
|
|
|
|
class NetworkTimer
|
|
{
|
|
QTimer *timer_ = nullptr;
|
|
|
|
bool started_{};
|
|
|
|
public:
|
|
int timeoutMS_ = -1;
|
|
|
|
NetworkTimer() = default;
|
|
~NetworkTimer() = default;
|
|
|
|
NetworkTimer(const NetworkTimer &other) = delete;
|
|
NetworkTimer &operator=(const NetworkTimer &other) = delete;
|
|
|
|
NetworkTimer(NetworkTimer &&other) = default;
|
|
NetworkTimer &operator=(NetworkTimer &&other) = default;
|
|
|
|
void start();
|
|
|
|
void onTimeout(NetworkWorker *worker, std::function<void()> cb) const;
|
|
|
|
bool isStarted() const;
|
|
};
|
|
|
|
} // namespace chatterino
|