OSDN Git Service

first
[psychlops/cpp.git] / psychlops / core / devices / psychlops_io_clock.h
1 /*\r
2  *  psychlops_io_clock.h\r
3  *  Psychlops Standard Library (Universal)\r
4  *\r
5  *  Last Modified 2005/12/19 by Kenchi HOSOKAWA\r
6  *  (C) 2005 Kenchi HOSOKAWA, Kazushi MARUYA, Takao SATO\r
7  */\r
8 \r
9 #ifndef HEADER_PSYCHLOPS_DEVICES_CLOCK\r
10 #define HEADER_PSYCHLOPS_DEVICES_CLOCK\r
11
12 #define PSYCHLOPS_CLOCK_API_PLATFORM
13 #include "../../platform/psychlops_platform_selector.h"\r
14 #undef PSYCHLOPS_CLOCK_API_PLATFORM\r
15 \r
16 \r
17 namespace Psychlops {\r
18 \r
19 \r
20         class Clock {
21                 private:\r
22                 CLOCK_UNIT clock_;\r
23                 static CLOCK_UNIT clocks_per_a_milisecond_;\r
24                 int frame_;\r
25                 bool is_just_;\r
26                 Clock(CLOCK_UNIT native_clock);\r
27 \r
28                 public:\r
29                 static void initialize();\r
30                 Clock();\r
31                 ~Clock();\r
32                 void update();\r
33 //              Clock operator -();\r
34                 Clock operator +(Clock &rhs);\r
35                 Clock operator -(Clock &rhs);\r
36                 //Clock operator *(double &rhs);\r
37                 //Clock operator /(double &rhs);\r
38                 //Clock operator %(double &rhs);\r
39                 Clock & operator +=(Clock &rhs);\r
40                 Clock & operator -=(Clock &rhs);\r
41                 //Clock & operator *=(double &rhs);\r
42                 //Clock & operator /=(double &rhs);\r
43                 bool operator ==(Clock &rhs);\r
44                 bool operator !=(Clock &rhs);\r
45                 bool operator >(Clock &rhs);\r
46                 bool operator <(Clock &rhs);\r
47                 bool operator >=(Clock &rhs);\r
48                 bool operator <=(Clock &rhs);\r
49                 double at_msec();\r
50         };\r
51 \r
52         long Gettime_ms();  // obsolete\r
53 \r
54 \r
55 }       /*      <- namespace Psycholops         */\r
56 \r
57 \r
58 #endif\r