00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef WIFI_TIMESTAMP_HH_
00023 # define WIFI_TIMESTAMP_HH_
00024
00025 # include <boost/array.hpp>
00026
00027 extern "C"
00028 {
00029 # include <inttypes.h>
00030 }
00031
00032 # include <ostream>
00033
00034 # include <wipal/tool/hash.hh>
00035
00036 namespace wpl
00037 {
00038
00039 namespace wifi
00040 {
00041
00043 struct timestamp
00044 {
00045 enum { size = 8 };
00046
00048 timestamp();
00049
00051 timestamp(uint32_t hi, uint32_t lo);
00052
00054
00055 bool operator == (const timestamp&) const;
00056 bool operator != (const timestamp&) const;
00057 bool operator < (const timestamp&) const;
00059
00061 std::ostream& print(std::ostream&) const;
00062
00065 size_t hash() const;
00066
00067 private:
00068 typedef boost::array<uint8_t, size> digits_t;
00069
00070 digits_t digits_;
00071 };
00072
00074 std::ostream&
00075 operator << (std::ostream&, const timestamp&);
00076
00077 }
00078
00079 }
00080
00081 WP_HASH_NAMESPACE_BEGIN
00082
00083 template <>
00084 struct hash<wpl::wifi::timestamp>
00085 {
00086 size_t operator () (const wpl::wifi::timestamp&) const;
00087 };
00088
00089 WP_HASH_NAMESPACE_END
00090
00091 # include "timestamp.hxx"
00092
00093 #endif // ! WIFI_TIMESTAMP_HH_