You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
833 B
C++
43 lines
833 B
C++
//
|
|
// Created by koncord on 03.05.17.
|
|
//
|
|
|
|
#ifndef OPENMW_PINGHELPER_HPP
|
|
#define OPENMW_PINGHELPER_HPP
|
|
|
|
#include <QObject>
|
|
#include <QAbstractTableModel>
|
|
#include <QThread>
|
|
#include "Types.hpp"
|
|
|
|
class PingUpdater;
|
|
|
|
class PingHelper : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
|
|
void Reset();
|
|
void Add(int row, const AddrPair &addrPair);
|
|
void Stop();
|
|
void SetModel(QAbstractTableModel *model);
|
|
//void UpdateImmedialy(PingUpdater::AddrPair addrPair);
|
|
static PingHelper &Get();
|
|
|
|
PingHelper(const PingHelper&) = delete;
|
|
PingHelper& operator=(const PingHelper&) = delete;
|
|
private:
|
|
PingHelper();
|
|
signals:
|
|
void stop();
|
|
public slots:
|
|
void update(int row, unsigned ping);
|
|
private:
|
|
QThread *pingThread;
|
|
PingUpdater *pingUpdater;
|
|
QAbstractTableModel *model;
|
|
};
|
|
|
|
|
|
#endif //OPENMW_PINGHELPER_HPP
|