source: trunk/lib/Stats.h @ 14

Last change on this file since 14 was 14, checked in by Peter Johansson, 16 years ago

adding Stats class and removed pointer from node to its mother(dir), which enforced some changes here and there

File size: 1.1 KB
Line 
1//$Id$
2
3#ifndef _theplu_svnstat_stats_
4#define _theplu_svnstat_stats_
5
6#include <map>
7#include <vector>
8
9namespace theplu{
10namespace svnstat{
11
12  ///
13  /// Class taking care of statistics from svn.
14  ///
15  class Stats
16  {
17  public:
18    ///
19    /// @brief Default Constructor
20    ///
21    Stats(void);
22   
23    ///
24    /// @return accumulated vector of total
25    ///
26    std::vector<u_int> accumulated(void) const;
27
28    ///
29    /// @return accumulated vector of stats_[user]
30    ///
31    std::vector<u_int> accumulated(const std::string& user);
32
33    ///
34    /// @brief adding a line to user from revision to the stats
35    ///
36    void add(const std::string& user, const u_int& revision); 
37
38    inline void reset(void) { map_.clear(); }
39
40
41    ///
42    /// @return resulting Stats
43    ///
44    Stats& operator+=(const Stats&);
45
46  private:
47    Stats(const Stats& other);
48
49    // Peter, if the vector is sparse make it a map
50    typedef std::map<std::string, std::vector<u_int> > _Map;
51    typedef _Map::iterator _MapIt;
52    typedef _Map::const_iterator _MapConstIt;
53    _Map map_;
54  };
55}}
56
57#endif // end of namespace svnstat end of namespace theplu
Note: See TracBrowser for help on using the repository browser.