Changeset 23 for trunk/lib/Stats.h


Ignore:
Timestamp:
Jan 2, 2006, 9:14:57 AM (16 years ago)
Author:
Peter Johansson
Message:

added print functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.h

    r14 r23  
    2222   
    2323    ///
     24    /// @brief adding a line to user from revision to the stats
     25    ///
     26    void add(const std::string& user, const u_int& revision);
     27
     28    ///
     29    /// @bief print statistics
     30    ///
     31    void print(std::ostream&) const;
     32
     33    ///
     34    /// @brief Clear all statistics
     35    ///
     36    inline void reset(void) { map_.clear(); }
     37
     38    ///
     39    /// @return resulting Stats
     40    ///
     41    Stats& operator+=(const Stats&);
     42
     43  private:
     44    ///
     45    /// Copy constructor (not implemented)
     46    ///
     47    Stats(const Stats& other);
     48
     49    ///
    2450    /// @return accumulated vector of total
    2551    ///
     
    3157    std::vector<u_int> accumulated(const std::string& user);
    3258
    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 
    4959    // 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_;
     60    typedef std::map<std::string, std::vector<u_int> > Map_;
     61    typedef Map_::iterator MapIter_;
     62    typedef Map_::const_iterator MapConstIter_;
     63    Map_ map_;
    5464  };
    5565}}
Note: See TracChangeset for help on using the changeset viewer.