2014-02-15 18:49:35 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2014-02-16 02:56:44 +05:30
|
|
|
class BaseInstance;
|
2014-02-15 18:49:35 +05:30
|
|
|
class SettingsObject;
|
|
|
|
class MinecraftProcess;
|
2014-02-15 22:45:41 +05:30
|
|
|
class QProcess;
|
2014-02-15 18:49:35 +05:30
|
|
|
|
|
|
|
class BaseProfiler : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-16 02:56:44 +05:30
|
|
|
explicit BaseProfiler(BaseInstance *instance, QObject *parent = 0);
|
2014-02-15 18:49:35 +05:30
|
|
|
virtual ~BaseProfiler();
|
|
|
|
|
|
|
|
public
|
|
|
|
slots:
|
|
|
|
void beginProfiling(MinecraftProcess *process);
|
|
|
|
|
|
|
|
protected:
|
2014-02-16 02:56:44 +05:30
|
|
|
BaseInstance *m_instance;
|
2014-02-15 18:49:35 +05:30
|
|
|
|
|
|
|
virtual void beginProfilingImpl(MinecraftProcess *process) = 0;
|
|
|
|
|
2014-02-15 22:45:41 +05:30
|
|
|
qint64 pid(QProcess *process);
|
|
|
|
|
2014-02-15 18:49:35 +05:30
|
|
|
signals:
|
|
|
|
void readyToLaunch(const QString &message);
|
|
|
|
};
|
|
|
|
|
|
|
|
class BaseProfilerFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~BaseProfilerFactory();
|
|
|
|
|
2014-02-16 02:56:44 +05:30
|
|
|
virtual QString name() const = 0;
|
|
|
|
|
2014-02-15 18:49:35 +05:30
|
|
|
virtual void registerSettings(SettingsObject *settings) = 0;
|
|
|
|
|
2014-02-16 02:56:44 +05:30
|
|
|
virtual BaseProfiler *createProfiler(BaseInstance *instance, QObject *parent = 0) = 0;
|
2014-02-15 18:49:35 +05:30
|
|
|
|
2014-02-16 02:56:44 +05:30
|
|
|
virtual bool check(QString *error) = 0;
|
2014-02-15 18:49:35 +05:30
|
|
|
virtual bool check(const QString &path, QString *error) = 0;
|
|
|
|
};
|