2014-02-15 13:19:35 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2014-02-15 21:26:44 +00:00
|
|
|
class BaseInstance;
|
2014-02-15 13:19:35 +00:00
|
|
|
class SettingsObject;
|
|
|
|
class MinecraftProcess;
|
2014-02-15 17:15:41 +00:00
|
|
|
class QProcess;
|
2014-02-15 13:19:35 +00:00
|
|
|
|
|
|
|
class BaseProfiler : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-15 21:26:44 +00:00
|
|
|
explicit BaseProfiler(BaseInstance *instance, QObject *parent = 0);
|
2014-02-15 13:19:35 +00:00
|
|
|
virtual ~BaseProfiler();
|
|
|
|
|
|
|
|
public
|
|
|
|
slots:
|
|
|
|
void beginProfiling(MinecraftProcess *process);
|
2014-02-16 07:54:52 +00:00
|
|
|
void abortProfiling();
|
2014-02-15 13:19:35 +00:00
|
|
|
|
|
|
|
protected:
|
2014-02-15 21:26:44 +00:00
|
|
|
BaseInstance *m_instance;
|
2014-02-16 07:54:52 +00:00
|
|
|
QProcess *m_profilerProcess;
|
2014-02-15 13:19:35 +00:00
|
|
|
|
|
|
|
virtual void beginProfilingImpl(MinecraftProcess *process) = 0;
|
2014-02-16 07:54:52 +00:00
|
|
|
virtual void abortProfilingImpl();
|
2014-02-15 13:19:35 +00:00
|
|
|
|
2014-02-15 17:15:41 +00:00
|
|
|
qint64 pid(QProcess *process);
|
|
|
|
|
2014-02-15 13:19:35 +00:00
|
|
|
signals:
|
|
|
|
void readyToLaunch(const QString &message);
|
2014-02-16 07:54:52 +00:00
|
|
|
void abortLaunch(const QString &message);
|
2014-02-15 13:19:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class BaseProfilerFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~BaseProfilerFactory();
|
|
|
|
|
2014-02-15 21:26:44 +00:00
|
|
|
virtual QString name() const = 0;
|
|
|
|
|
2014-02-15 13:19:35 +00:00
|
|
|
virtual void registerSettings(SettingsObject *settings) = 0;
|
|
|
|
|
2014-02-15 21:26:44 +00:00
|
|
|
virtual BaseProfiler *createProfiler(BaseInstance *instance, QObject *parent = 0) = 0;
|
2014-02-15 13:19:35 +00:00
|
|
|
|
2014-02-15 21:26:44 +00:00
|
|
|
virtual bool check(QString *error) = 0;
|
2014-02-15 13:19:35 +00:00
|
|
|
virtual bool check(const QString &path, QString *error) = 0;
|
|
|
|
};
|