00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_FRAME_STATS_GROWTH_HH_
00023 # define WIFI_FRAME_STATS_GROWTH_HH_
00024
00025 # include <wipal/wifi/frame/stats/epoch_tracker.hh>
00026 # include <wipal/wifi/frame/stats/abstract_stats.hh>
00027
00028 namespace wifi
00029 {
00030
00031 namespace frame
00032 {
00033
00034 namespace stats
00035 {
00036
00037 template <class T, unsigned EpochLength>
00038 struct growth: public abstract_stats
00039 {
00040 void restart();
00041 void update(const tool::microseconds& timestamp);
00042 void update(const T& elt);
00043 std::ostream& print(std::ostream& o) const;
00044
00045 private:
00046 struct epoch_data
00047 {
00048 epoch_data();
00049
00050 unsigned total_count;
00051 unsigned current_count;
00052 };
00053
00054 std::set<T> elements_;
00055 std::set<T> current_elements_;
00056 epoch_tracker<epoch_data, EpochLength> tracker_;
00057 };
00058
00059 }
00060
00061 }
00062
00063 }
00064
00065 # include "growth.hxx"
00066
00067 #endif // ! WIFI_FRAME_STATS_GROWTH_HH_