2014-02-15 13:19:35 +00:00
|
|
|
#pragma once
|
|
|
|
|
2014-02-16 11:52:35 +00:00
|
|
|
#include "BaseExternalTool.h"
|
2019-04-07 21:59:04 +00:00
|
|
|
#include "QObjectPtr.h"
|
2014-02-15 13:19:35 +00:00
|
|
|
|
2014-02-15 21:26:44 +00:00
|
|
|
class BaseInstance;
|
2014-02-15 13:19:35 +00:00
|
|
|
class SettingsObject;
|
2015-07-09 23:11:06 +00:00
|
|
|
class LaunchTask;
|
2014-02-15 17:15:41 +00:00
|
|
|
class QProcess;
|
2014-02-15 13:19:35 +00:00
|
|
|
|
2021-07-25 17:11:59 +00:00
|
|
|
class BaseProfiler : public BaseExternalTool
|
2014-02-15 13:19:35 +00:00
|
|
|
{
|
2018-07-15 12:51:05 +00:00
|
|
|
Q_OBJECT
|
2014-02-15 13:19:35 +00:00
|
|
|
public:
|
2018-07-15 12:51:05 +00:00
|
|
|
explicit BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0);
|
2014-02-15 13:19:35 +00:00
|
|
|
|
|
|
|
public
|
|
|
|
slots:
|
2019-04-07 21:59:04 +00:00
|
|
|
void beginProfiling(shared_qobject_ptr<LaunchTask> process);
|
2018-07-15 12:51:05 +00:00
|
|
|
void abortProfiling();
|
2014-02-15 13:19:35 +00:00
|
|
|
|
|
|
|
protected:
|
2018-07-15 12:51:05 +00:00
|
|
|
QProcess *m_profilerProcess;
|
2014-02-15 13:19:35 +00:00
|
|
|
|
2019-04-07 21:59:04 +00:00
|
|
|
virtual void beginProfilingImpl(shared_qobject_ptr<LaunchTask> process) = 0;
|
2018-07-15 12:51:05 +00:00
|
|
|
virtual void abortProfilingImpl();
|
2014-02-15 13:19:35 +00:00
|
|
|
|
|
|
|
signals:
|
2018-07-15 12:51:05 +00:00
|
|
|
void readyToLaunch(const QString &message);
|
|
|
|
void abortLaunch(const QString &message);
|
2014-02-15 13:19:35 +00:00
|
|
|
};
|
|
|
|
|
2021-07-25 17:11:59 +00:00
|
|
|
class BaseProfilerFactory : public BaseExternalToolFactory
|
2014-02-15 13:19:35 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-07-15 12:51:05 +00:00
|
|
|
virtual BaseProfiler *createProfiler(InstancePtr instance, QObject *parent = 0);
|
2014-02-15 13:19:35 +00:00
|
|
|
};
|