forked from qt-creator/qt-creator
Analyzer: Simplify IAnalyzerEngine interface
Change-Id: Id5eac0145e04b809bf535087d3bb9a04124c2e87 Reviewed-by: Aurindam Jana <aurindam.jana@digia.com> Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
This commit is contained in:
@@ -32,19 +32,11 @@
|
|||||||
|
|
||||||
namespace Analyzer {
|
namespace Analyzer {
|
||||||
|
|
||||||
IAnalyzerEngine::IAnalyzerEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
IAnalyzerEngine::IAnalyzerEngine(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
m_runConfig = runConfiguration;
|
m_runConfig = runConfiguration;
|
||||||
m_sp = sp;
|
m_sp = sp;
|
||||||
m_tool = tool;
|
|
||||||
}
|
|
||||||
|
|
||||||
IAnalyzerEngine::IAnalyzerEngine(IAnalyzerTool *tool,
|
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
|
||||||
{
|
|
||||||
m_runConfig = runConfiguration;
|
|
||||||
m_tool = tool;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Analyzer
|
} // namespace Analyzer
|
||||||
|
@@ -46,8 +46,6 @@ class RunConfiguration;
|
|||||||
|
|
||||||
namespace Analyzer {
|
namespace Analyzer {
|
||||||
|
|
||||||
class IAnalyzerTool;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An IAnalyzerEngine instance handles the launch of an analyzation tool.
|
* An IAnalyzerEngine instance handles the launch of an analyzation tool.
|
||||||
*
|
*
|
||||||
@@ -58,9 +56,7 @@ class ANALYZER_EXPORT IAnalyzerEngine : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IAnalyzerEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
IAnalyzerEngine(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
|
||||||
IAnalyzerEngine(IAnalyzerTool *tool,
|
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||||
|
|
||||||
/// Start analyzation process.
|
/// Start analyzation process.
|
||||||
@@ -79,8 +75,6 @@ public:
|
|||||||
/// The start parameters for this engine.
|
/// The start parameters for this engine.
|
||||||
const AnalyzerStartParameters &startParameters() const { return m_sp; }
|
const AnalyzerStartParameters &startParameters() const { return m_sp; }
|
||||||
|
|
||||||
/// The tool this engine is associated with.
|
|
||||||
IAnalyzerTool *tool() const { return m_tool; }
|
|
||||||
StartMode mode() const { return m_sp.startMode; }
|
StartMode mode() const { return m_sp.startMode; }
|
||||||
|
|
||||||
virtual void notifyRemoteSetupDone(quint16) {}
|
virtual void notifyRemoteSetupDone(quint16) {}
|
||||||
@@ -104,7 +98,6 @@ signals:
|
|||||||
private:
|
private:
|
||||||
ProjectExplorer::RunConfiguration *m_runConfig;
|
ProjectExplorer::RunConfiguration *m_runConfig;
|
||||||
AnalyzerStartParameters m_sp;
|
AnalyzerStartParameters m_sp;
|
||||||
IAnalyzerTool *m_tool;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Analyzer
|
} // namespace Analyzer
|
||||||
|
@@ -77,10 +77,9 @@ public:
|
|||||||
// QmlProfilerEngine
|
// QmlProfilerEngine
|
||||||
//
|
//
|
||||||
|
|
||||||
QmlProfilerEngine::QmlProfilerEngine(IAnalyzerTool *tool,
|
QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||||
const Analyzer::AnalyzerStartParameters &sp,
|
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||||
: IAnalyzerEngine(tool, sp, runConfiguration)
|
: IAnalyzerEngine(sp, runConfiguration)
|
||||||
, d(new QmlProfilerEnginePrivate(sp))
|
, d(new QmlProfilerEnginePrivate(sp))
|
||||||
{
|
{
|
||||||
d->m_profilerState = 0;
|
d->m_profilerState = 0;
|
||||||
|
@@ -30,8 +30,9 @@
|
|||||||
#ifndef QMLPROFILERENGINE_H
|
#ifndef QMLPROFILERENGINE_H
|
||||||
#define QMLPROFILERENGINE_H
|
#define QMLPROFILERENGINE_H
|
||||||
|
|
||||||
#include <analyzerbase/ianalyzerengine.h>
|
|
||||||
#include "qmlprofilerstatemanager.h"
|
#include "qmlprofilerstatemanager.h"
|
||||||
|
|
||||||
|
#include <analyzerbase/ianalyzerengine.h>
|
||||||
#include <utils/outputformat.h>
|
#include <utils/outputformat.h>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
@@ -42,8 +43,7 @@ class QmlProfilerEngine : public Analyzer::IAnalyzerEngine
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmlProfilerEngine(Analyzer::IAnalyzerTool *tool,
|
QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||||
const Analyzer::AnalyzerStartParameters &sp,
|
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||||
~QmlProfilerEngine();
|
~QmlProfilerEngine();
|
||||||
|
|
||||||
|
@@ -223,7 +223,7 @@ IAnalyzerTool::ToolMode QmlProfilerTool::toolMode() const
|
|||||||
IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp,
|
IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp,
|
||||||
RunConfiguration *runConfiguration)
|
RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
QmlProfilerEngine *engine = new QmlProfilerEngine(this, sp, runConfiguration);
|
QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration);
|
||||||
|
|
||||||
engine->registerProfilerStateManager(d->m_profilerState);
|
engine->registerProfilerStateManager(d->m_profilerState);
|
||||||
|
|
||||||
|
@@ -42,9 +42,9 @@ using namespace Analyzer;
|
|||||||
using namespace Valgrind;
|
using namespace Valgrind;
|
||||||
using namespace Valgrind::Internal;
|
using namespace Valgrind::Internal;
|
||||||
|
|
||||||
CallgrindEngine::CallgrindEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
CallgrindEngine::CallgrindEngine(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||||
: ValgrindEngine(tool, sp, runConfiguration)
|
: ValgrindEngine(sp, runConfiguration)
|
||||||
, m_markAsPaused(false)
|
, m_markAsPaused(false)
|
||||||
{
|
{
|
||||||
connect(&m_runner, SIGNAL(finished()), this, SLOT(slotFinished()));
|
connect(&m_runner, SIGNAL(finished()), this, SLOT(slotFinished()));
|
||||||
|
@@ -43,7 +43,7 @@ class CallgrindEngine : public Valgrind::Internal::ValgrindEngine
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CallgrindEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
|
CallgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||||
|
|
||||||
bool start();
|
bool start();
|
||||||
|
@@ -572,7 +572,7 @@ IAnalyzerEngine *CallgrindTool::createEngine(const AnalyzerStartParameters &sp,
|
|||||||
IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameters &sp,
|
IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
CallgrindEngine *engine = new CallgrindEngine(q, sp, runConfiguration);
|
CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration);
|
||||||
|
|
||||||
connect(engine, SIGNAL(parserDataReady(CallgrindEngine*)),
|
connect(engine, SIGNAL(parserDataReady(CallgrindEngine*)),
|
||||||
SLOT(takeParserData(CallgrindEngine*)));
|
SLOT(takeParserData(CallgrindEngine*)));
|
||||||
|
@@ -45,9 +45,9 @@ using namespace Valgrind::XmlProtocol;
|
|||||||
namespace Valgrind {
|
namespace Valgrind {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
MemcheckEngine::MemcheckEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
MemcheckEngine::MemcheckEngine(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||||
: ValgrindEngine(tool, sp, runConfiguration)
|
: ValgrindEngine(sp, runConfiguration)
|
||||||
{
|
{
|
||||||
connect(&m_parser, SIGNAL(error(Valgrind::XmlProtocol::Error)),
|
connect(&m_parser, SIGNAL(error(Valgrind::XmlProtocol::Error)),
|
||||||
SIGNAL(parserError(Valgrind::XmlProtocol::Error)));
|
SIGNAL(parserError(Valgrind::XmlProtocol::Error)));
|
||||||
|
@@ -44,7 +44,7 @@ class MemcheckEngine : public ValgrindEngine
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MemcheckEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
|
MemcheckEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||||
|
|
||||||
bool start();
|
bool start();
|
||||||
|
@@ -451,7 +451,7 @@ IAnalyzerEngine *MemcheckTool::createEngine(const AnalyzerStartParameters &sp,
|
|||||||
m_frameFinder->setFiles(runConfiguration ? runConfiguration->target()
|
m_frameFinder->setFiles(runConfiguration ? runConfiguration->target()
|
||||||
->project()->files(Project::AllFiles) : QStringList());
|
->project()->files(Project::AllFiles) : QStringList());
|
||||||
|
|
||||||
MemcheckEngine *engine = new MemcheckEngine(this, sp, runConfiguration);
|
MemcheckEngine *engine = new MemcheckEngine(sp, runConfiguration);
|
||||||
|
|
||||||
connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
|
connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
|
||||||
this, SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
|
this, SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
|
||||||
|
@@ -53,9 +53,9 @@ namespace Internal {
|
|||||||
|
|
||||||
const int progressMaximum = 1000000;
|
const int progressMaximum = 1000000;
|
||||||
|
|
||||||
ValgrindEngine::ValgrindEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
ValgrindEngine::ValgrindEngine(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||||
: IAnalyzerEngine(tool, sp, runConfiguration),
|
: IAnalyzerEngine(sp, runConfiguration),
|
||||||
m_settings(0),
|
m_settings(0),
|
||||||
m_progress(new QFutureInterface<void>()),
|
m_progress(new QFutureInterface<void>()),
|
||||||
m_progressWatcher(new QFutureWatcher<void>()),
|
m_progressWatcher(new QFutureWatcher<void>()),
|
||||||
|
@@ -48,8 +48,7 @@ class ValgrindEngine : public Analyzer::IAnalyzerEngine
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ValgrindEngine(Analyzer::IAnalyzerTool *tool,
|
ValgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||||
const Analyzer::AnalyzerStartParameters &sp,
|
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||||
~ValgrindEngine();
|
~ValgrindEngine();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user