-
Notifications
You must be signed in to change notification settings - Fork 1
/
analyser.hpp
53 lines (44 loc) · 1.61 KB
/
analyser.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* NPath complexity analyser for C++.
Copyright (C) 2007 Eddy Pronk
Gnocchi is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Gnocchi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#ifndef ANALYSER_HPP_
#define ANALYSER_HPP_
#include <set>
#include <vector>
#include "graph.hpp"
#include "reporter.hpp"
#include "function_data.hpp"
#include <boost/signal.hpp>
#include "gcov_reader.hpp"
typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
typedef boost::graph_traits<Graph>::vertices_size_type size_type;
class Analyser
{
public:
Analyser(reporter& r)
: reporter_(r)
{
}
void process(const gcov_reader&);
void calculate_npath(const gcov_reader&, const Graph&, data_model&);
void calculate_npath_2(const Graph&, data_model&);
void report(int /*npath_threshold*/);
typedef boost::signal<void (const gcov_reader&, data_model&, std::vector<long>)> line_insert_signal_type;
line_insert_signal_type on_complexity_calculated;
private:
reporter& reporter_;
typedef std::set<data_model> function_index;
function_index functions;
};
#endif