OSDN Git Service

ff9cdac264f66ac2fe52a2f3c6338b589a36ff49
[qt-creator-jp/qt-creator-jp.git] / src / plugins / valgrindtoolbase / valgrindengine.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
8 **
9 ** Contact: Nokia Corporation (qt-info@nokia.com)
10 **
11 ** No Commercial Usage
12 **
13 ** This file contains pre-release code and may not be distributed.
14 ** You may use this file in accordance with the terms and conditions
15 ** contained in the Technology Preview License Agreement accompanying
16 ** this package.
17 **
18 ** GNU Lesser General Public License Usage
19 **
20 ** Alternatively, this file may be used under the terms of the GNU Lesser
21 ** General Public License version 2.1 as published by the Free Software
22 ** Foundation and appearing in the file LICENSE.LGPL included in the
23 ** packaging of this file.  Please review the following information to
24 ** ensure the GNU Lesser General Public License version 2.1 requirements
25 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
26 **
27 ** In addition, as a special exception, Nokia gives you certain additional
28 ** rights.  These rights are described in the Nokia Qt LGPL Exception
29 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
30 **
31 ** If you have questions regarding the use of this file, please contact
32 ** Nokia at qt-info@nokia.com.
33 **
34 **************************************************************************/
35
36 #ifndef VALGRINDENGINE_H
37 #define VALGRINDENGINE_H
38
39 #include "valgrindtoolbase_global.h"
40
41 #include <analyzerbase/ianalyzerengine.h>
42
43 #include <utils/environment.h>
44
45 #include <valgrind/valgrindrunner.h>
46
47 #include <QtCore/QString>
48 #include <QtCore/QByteArray>
49 #include <QtCore/QFutureInterface>
50
51 namespace Analyzer {
52
53 class AnalyzerSettings;
54
55 namespace Internal {
56
57 class VALGRINDTOOLBASE_EXPORT ValgrindEngine : public IAnalyzerEngine
58 {
59     Q_OBJECT
60 public:
61     explicit ValgrindEngine(ProjectExplorer::RunConfiguration *runConfiguration);
62     virtual ~ValgrindEngine();
63
64     void start();
65     void stop();
66
67     QString executable() const;
68
69 protected:
70     virtual QString progressTitle() const = 0;
71     virtual QStringList toolArguments() const = 0;
72     virtual Valgrind::ValgrindRunner *runner() = 0;
73
74     AnalyzerSettings *m_settings;
75     QFutureInterface<void> *m_progress;
76
77 private slots:
78     void runnerFinished();
79
80     void receiveStandardOutput(const QByteArray &);
81     void receiveStandardError(const QByteArray &);
82     void receiveProcessError(const QString &, QProcess::ProcessError);
83
84 private:
85     QString m_workingDirectory;
86     QString m_executable;
87     QString m_commandLineArguments;
88     Utils::Environment m_environment;
89     bool m_isStopping;
90 };
91
92 } // namespace Internal
93 } // namespace Analyzer
94
95 #endif // VALGRINDENGINE_H