source: trunk/lib/StatsPlotter.h @ 1513

Last change on this file since 1513 was 1513, checked in by Peter Johansson, 9 years ago

remove trailing whitespace

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#ifndef _theplu_svndigest_stats_plotter_
2#define _theplu_svndigest_stats_plotter_
3
4// $Id: StatsPlotter.h 1513 2012-09-23 04:09:08Z peter $
5
6/*
7  Copyright (C) 2010 Peter Johansson
8
9  This file is part of svndigest, http://dev.thep.lu.se/svndigest
10
11  svndigest is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 3 of the License, or
14  (at your option) any later version.
15
16  svndigest is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
23*/
24
25#include "Vector.h"
26
27#include <string>
28#include <map>
29
30namespace theplu {
31namespace svndigest {
32
33  class Stats;
34
35  /**
36     Class plotting a Stats object
37  */
38  class StatsPlotter
39  {
40  public:
41    /**
42        \brief Default Constructor
43    */
44    explicit StatsPlotter(const Stats& stats);
45
46    /**
47       \brief Destructor
48    */
49    virtual ~StatsPlotter(void);
50
51    /**
52       Create statistics graph.
53    */
54    std::string plot(const std::string&, const std::string&) const;
55
56    /**
57       Plotting code, comment, other, and total in same plot (for
58       'all' not individual authors).
59    */
60    void plot_summary(const std::string& output) const;
61
62  private:
63    typedef std::map<std::string, SumVector> Author2Vector;
64    const Stats& stats_;
65
66    /**
67       called from plot(2)
68     */
69    void plot(const std::string& basename, const std::string& linetype,
70              const std::string& format) const;
71
72    /**
73       called from plot_summary(1)
74     */
75    void plot_summary(const std::string& basename,
76                      const std::string& format) const;
77
78  };
79}} // end of namespace svndigest end of namespace theplu
80
81#endif
Note: See TracBrowser for help on using the repository browser.