This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Functions | |
| void | stop_watching_nml (int) |
| int | nml_watch (char *config_file, char *buffer, double sample_period) |
|
|
Definition at line 63 of file nmlwatch.cc. 00064 {
00065 stop = 1;
00066 }
|
|
||||||||||||||||
|
Definition at line 75 of file nmlwatch.cc. Referenced by main().
00076 {
00077 NML *nml;
00078 RCS_TIMER *timer;
00079 NMLmsg *nmlmsg;
00080 NMLTYPE peek_ret;
00081 double start_time;
00082 rcs_print ("NMLWATCH(%s,%s,%lf) called.\n",
00083 config_file, buffer, sample_period);
00084 timer = new RCS_TIMER (sample_period);
00085 stop = 0;
00086 nml = new NML (format_stub, buffer, "nmlwatch", config_file);
00087 if (NULL == nml)
00088 {
00089 rcs_print_error ("NMLWATCH: Can't create nml channel.\n");
00090 delete timer;
00091 return -1;
00092 }
00093 if (!nml->valid ())
00094 {
00095 rcs_print_error ("NMLWATCH: Can't create nml channel.\n");
00096 delete nml;
00097 delete timer;
00098 return -1;
00099 }
00100 #ifdef sparcworks_sun4
00101 signal (SIGINT, (void (*)(int,...)) stop_watching_nml);
00102 #else
00103 signal (SIGINT, stop_watching_nml);
00104 #endif
00105 rcs_print ("Waiting for messages.\n");
00106 start_time = etime ();
00107 while (!stop)
00108 {
00109 peek_ret = nml->peek ();
00110 switch (peek_ret)
00111 {
00112 case 0:
00113 break;
00114
00115 case -1:
00116 rcs_print_error ("NMLWATCH: Can`t read nml channel.\n");
00117 delete nml;
00118 delete timer;
00119 return (-1);
00120
00121 default:
00122 nmlmsg = nml->get_address ();
00123 rcs_print ("NML message %ld of size %ld recieved at t=%lf.\n",
00124 nmlmsg->type, nmlmsg->size, etime () - start_time);
00125 break;
00126 }
00127 timer->wait ();
00128 }
00129 rcs_print ("NMLWATCH is quitting.\n");
00130 delete nml;
00131 delete timer;
00132 return (0);
00133 }
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001