1 #ifndef VRPN_IMAGER_STREAM_BUFFER_H
2 #define VRPN_IMAGER_STREAM_BUFFER_H
32 d_first = d_last = NULL;
37 while (d_first != NULL) {
45 unsigned size(
void)
const {
return d_count; }
60 if (d_first == NULL) {
78 if (d_last == d_first) {
82 d_first = d_first->
next;
117 d_time_to_exit =
false;
118 d_description_updated =
false;
119 d_nRows = d_nCols = d_nDepth = d_nChannels = 0;
120 d_new_log_request =
false;
121 d_request_lil = NULL;
122 d_request_lol = NULL;
123 d_request_ril = NULL;
124 d_request_rol = NULL;
125 d_new_log_result =
false;
130 d_new_throttle_request =
false;
131 d_throttle_count = -1;
132 d_frames_in_queue = 0;
140 bool ret = d_time_to_exit;
147 d_time_to_exit = do_exit;
157 vrpn_int32 &nDepth, vrpn_int32 &nChannels,
158 const char **channelBuffer)
161 bool ret = d_description_updated;
162 if (d_description_updated) {
166 nChannels = d_nChannels;
167 *channelBuffer = d_channel_buffer;
169 d_description_updated =
false;
174 vrpn_int32 nDepth, vrpn_int32 nChannels,
175 const char *channelBuffer)
181 d_nChannels = nChannels;
182 d_channel_buffer = channelBuffer;
183 d_description_updated =
true;
202 bool ret = d_new_log_request;
203 if (d_new_log_request) {
206 if ((*lil =
new char[strlen(d_request_lil) + 1]) != NULL) {
207 strcpy(*lil, d_request_lil);
209 if ((*lol =
new char[strlen(d_request_lol) + 1]) != NULL) {
210 strcpy(*lol, d_request_lol);
212 if ((*ril =
new char[strlen(d_request_ril) + 1]) != NULL) {
213 strcpy(*ril, d_request_ril);
215 if ((*rol =
new char[strlen(d_request_rol) + 1]) != NULL) {
216 strcpy(*rol, d_request_rol);
220 delete[] d_request_lil;
221 d_request_lil = NULL;
222 delete[] d_request_lol;
223 d_request_lol = NULL;
224 delete[] d_request_ril;
225 d_request_ril = NULL;
226 delete[] d_request_rol;
227 d_request_rol = NULL;
229 d_new_log_request =
false;
242 delete[] d_request_lil;
243 d_request_lil = NULL;
246 delete[] d_request_lol;
247 d_request_lol = NULL;
250 delete[] d_request_ril;
251 d_request_ril = NULL;
254 delete[] d_request_rol;
255 d_request_rol = NULL;
260 if ((d_request_lil =
new char[strlen(lil) + 1]) != NULL) {
261 strcpy(d_request_lil, lil);
265 if ((d_request_lol =
new char[strlen(lol) + 1]) != NULL) {
266 strcpy(d_request_lol, lol);
270 if ((d_request_ril =
new char[strlen(ril) + 1]) != NULL) {
271 strcpy(d_request_ril, ril);
275 if ((d_request_rol =
new char[strlen(rol) + 1]) != NULL) {
276 strcpy(d_request_rol, rol);
280 d_new_log_request =
true;
297 bool ret = d_new_log_result;
298 if (d_new_log_result) {
301 if (d_result_lil == NULL)
304 if ((*lil =
new char[strlen(d_result_lil) + 1]) != NULL) {
305 strcpy(*lil, d_result_lil);
308 if (d_result_lol == NULL)
311 if ((*lol =
new char[strlen(d_result_lol) + 1]) != NULL) {
312 strcpy(*lol, d_result_lol);
315 if (d_result_ril == NULL)
318 if ((*ril =
new char[strlen(d_result_ril) + 1]) != NULL) {
319 strcpy(*ril, d_result_ril);
322 if (d_result_rol == NULL)
325 if ((*rol =
new char[strlen(d_result_rol) + 1]) != NULL) {
326 strcpy(*rol, d_result_rol);
333 d_new_log_result =
false;
343 if (d_result_lil)
delete[] d_result_lil;
345 if (d_result_lol)
delete[] d_result_lol;
347 if (d_result_ril)
delete[] d_result_ril;
349 if (d_result_rol)
delete[] d_result_rol;
354 if ((d_result_lil =
new char[strlen(lil) + 1]) != NULL) {
355 strcpy(d_result_lil, lil);
359 if ((d_result_lol =
new char[strlen(lol) + 1]) != NULL) {
360 strcpy(d_result_lol, lol);
364 if ((d_result_ril =
new char[strlen(ril) + 1]) != NULL) {
365 strcpy(d_result_ril, ril);
369 if ((d_result_rol =
new char[strlen(rol) + 1]) != NULL) {
370 strcpy(d_result_rol, rol);
374 d_new_log_result =
true;
388 if (d_result_lil == NULL)
391 *local_in =
new char[strlen(d_result_lil) + 1];
392 strcpy(*local_in, d_result_lil);
394 if (d_result_lol == NULL)
397 *local_out =
new char[strlen(d_result_lol) + 1];
398 strcpy(*local_out, d_result_lol);
400 if (d_result_ril == NULL)
403 *remote_in =
new char[strlen(d_result_ril) + 1];
404 strcpy(*remote_in, d_result_ril);
406 if (d_result_rol == NULL)
409 *remote_out =
new char[strlen(d_result_rol) + 1];
410 strcpy(*remote_out, d_result_rol);
420 bool ret = d_new_throttle_request;
421 if (d_new_throttle_request) {
422 *throttle_count = d_throttle_count;
424 d_new_throttle_request =
false;
431 d_throttle_count = throttle_count;
432 d_new_throttle_request =
true;
443 vrpn_int32 ret = d_frames_in_queue;
451 vrpn_int32 ret = d_frames_in_queue;
459 vrpn_int32 ret = d_frames_in_queue;
469 vrpn_int32 ret = d_logger_to_client_messages.size();
476 bool ret = d_logger_to_client_messages.insert_back(p);
483 bool ret = d_logger_to_client_messages.retrieve_front(p);
583 const char *local_out_logfile_name,
584 const char *remote_in_logfile_name,
585 const char *remote_out_logfile_name);
610 virtual void handle_got_first_connection(
void);
638 void logging_thread_func(
void);
642 bool stop_logging_thread(
void);
655 open_new_log_connection(
const char *local_in_logfile_name,
656 const char *local_out_logfile_name,
657 const char *remote_in_logfile_name,
658 const char *remote_out_logfile_name);
672 bool make_new_logging_connection(
const char *local_in_logfile_name,
673 const char *local_out_logfile_name,
674 const char *remote_in_logfile_name,
675 const char *remote_out_logfile_name);
685 handle_image_description(
void *pvISB,
const struct timeval msg_time);
728 vrpn_int32 transcode_type(vrpn_int32 type);