ARPDAS_QNX6 1.0
DCph.cc
Go to the documentation of this file.
00001 #include "DCph.h"
00002 #include <Pt.h>
00003 #include "nortlib.h"
00004 
00005 ph_data_client::ph_data_client( int bufsize_in, int fast, int non_block )
00006     : data_client(bufsize_in, 1, 1 ) {
00007   if (PtInit(NULL) == -1)
00008     nl_error(3, "Cannot initialize Photon Connection");
00009 }
00010 
00011 PtFdProcF_t DCPH_fd_handler;
00012 int DCPH_fd_handler( int fd, void *data, unsigned mode) {
00013   ph_data_client *DC = (ph_data_client *)data;
00014   return DC->read();
00015 }
00016 
00017 int ph_data_client::read() {
00018   data_client::read();
00019   PtFlush();
00020   if ( dc_quit ) PtExit(0);
00021   return Pt_CONTINUE;
00022 }
00023 
00024 void ph_data_client::operate() {
00025   tminitfunc();
00026   PtAppAddFd( NULL, bfr_fd, Pt_FD_READ, DCPH_fd_handler, this );
00027   PtMainLoop();
00028 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines