00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TOOL_MICROSECONDS_HH_
00023 # define TOOL_MICROSECONDS_HH_
00024
00025 extern "C"
00026 {
00027 # include <stdint.h>
00028 # include <sys/time.h>
00029 }
00030 # include <gmpxx.h>
00031
00032 namespace tool
00033 {
00034
00036 struct microseconds: public mpz_class
00037 {
00038 typedef mpz_class mpz_type;
00039
00041 microseconds(const uint64_t);
00042
00044 microseconds(const struct timeval& tv);
00045
00046
00048
00049
00051 microseconds(const mpz_type&);
00052
00054 template <class T1, class T2>
00055 microseconds(const __gmp_expr<T1, T2>& e);
00056
00058
00060 uint32_t get_prism_mactime() const;
00061
00063 uint32_t get_prism_hosttime() const;
00064
00066 uint64_t get_uint64() const;
00067
00074 unsigned get_div_by(unsigned d) const;
00075
00077 struct timeval get_timeval() const;
00078 };
00079
00080 }
00081
00082 # include "microseconds.hxx"
00083
00084 #endif // TOOL_MICROSECONDS_HH_