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_EPOCH_TRACKER_HH_
00023 # define WIFI_FRAME_STATS_EPOCH_TRACKER_HH_
00024
00025 # include <vector>
00026
00027 # include <wipal/tool/microseconds.hh>
00028
00029 namespace wifi
00030 {
00031
00032 namespace frame
00033 {
00034
00035 namespace stats
00036 {
00037
00038 template <class T, unsigned EpochLength>
00039 struct epoch_tracker
00040 {
00041 epoch_tracker();
00042
00043 void restart();
00044 bool update(const tool::microseconds& timestamp);
00045 const std::vector<T>& epochs() const;
00046 std::vector<T>& epochs();
00047 const T& current() const;
00048 T& current();
00049
00050 private:
00051 std::vector<T> epochs_;
00052 tool::microseconds epoch_start_;
00053 unsigned epoch_idx_;
00054 };
00055
00056 }
00057
00058 }
00059
00060 }
00061
00062 # include "epoch_tracker.hxx"
00063
00064 #endif // ! WIFI_FRAME_STATS_EPOCH_TRACKER_HH_