ARPDAS_QNX6 1.0
|
00001 #ifndef DG_TMR_H 00002 #define DG_TMR_H 00003 00004 #include <sys/iofunc.h> 00005 #include <sys/dispatch.h> 00006 #include <time.h> 00007 #include <stdint.h> 00008 #include "DG_Resmgr.h" 00009 #include "nortlib.h" 00010 #include "DG.h" 00011 00012 class data_generator; 00013 00014 class DG_tmr : public DG_dispatch_client { 00015 public: 00016 DG_tmr(data_generator *data_gen); 00017 ~DG_tmr(); 00018 void attach(); 00019 void settime( int per_sec, int per_nsec ); 00020 void settime( uint64_t nsecs ); 00021 int ready_to_quit(); 00022 data_generator *dg; 00023 uint64_t timer_resolution_nsec; 00024 private: 00025 int timerid; // set to -1 before initialization and after cleanup 00026 int pulse_code; 00027 }; 00028 00029 extern "C" { 00030 int DG_tmr_pulse_func( message_context_t *ctp, int code, 00031 unsigned flags, void *handle ); 00032 } 00033 00034 #endif 00035