Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/QNX4/Group5/TTest.hpp

Go to the documentation of this file.
00001 /***
00002    NAME
00003      ttest
00004    PURPOSE
00005      Test for threaded timer
00006    NOTES
00007      Stupid.  Idiotic.  Should work properly.
00008    HISTORY
00009      b_goudre -- Feb 22, 2000: Created.
00010 ***/
00011 #ifndef __TTEST__DEFINED
00012 #define __TTEST__DEFINED
00013 
00014 #include "timer.hh"
00015 #include <stdio.h>
00016 #include <unistd.h>
00017 
00018 extern timespec TICK_INTERVAL;
00019 
00020 class Timer_test : public Timer_thread
00021 {
00022 public:
00023     Timer_test() : Timer_thread(), count_(0) {};
00024     void tick();
00025     ~Timer_test() 
00026     {
00027         printf("Timer terminated.\n");
00028     }
00029 private:
00030     int count_;
00031 };
00032 
00033 class Timer_test_proxy
00034 {
00035 public:
00036     Timer_test_proxy(timespec& ts = TICK_INTERVAL)
00037     {
00038         int pid = t_.start(ts);
00039         printf("Timer started: pid %d (getpid returned %d)\nPress any key to stop.\n",
00040    pid, getpid());
00041     }
00042     int proxy_error() 
00043     {
00044         return t_.get_pid() == -1;
00045     }
00046     ~Timer_test_proxy()
00047     {
00048         t_.stop();
00049     }
00050 private:
00051     Timer_test t_;
00052 };
00053 
00054 #endif /* __TTEST__DEFINED */

Generated on Sun Oct 14 18:46:42 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001