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 wifi
00037 {
00038
00040 struct timestamp
00041 {
00042 enum { size = 8 };
00043
00045 timestamp();
00046
00048 timestamp(uint32_t hi, uint32_t lo);
00049
00051
00052 bool operator == (const timestamp&) const;
00053 bool operator != (const timestamp&) const;
00054 bool operator < (const timestamp&) const;
00056
00058 std::ostream& print(std::ostream&) const;
00059
00061 size_t hash() const;
00062
00063 private:
00064 typedef boost::array<uint8_t, size> digits_t;
00065
00066 digits_t digits_;
00067 };
00068
00070 std::ostream&
00071 operator << (std::ostream&, const timestamp&);
00072
00073 }
00074
00075 WP_HASH_NAMESPACE_BEGIN
00076
00077 template <>
00078 struct hash<wifi::timestamp>
00079 {
00080 size_t operator () (const wifi::timestamp&) const;
00081 };
00082
00083 WP_HASH_NAMESPACE_END
00084
00085 # include "timestamp.hxx"
00086
00087 #endif // ! WIFI_TIMESTAMP_HH_