28 #ifndef SLAVE_THREAD_HPP
29 #define SLAVE_THREAD_HPP
31 #include "../my_config.h"
33 #if HAVE_LIBTHREADAR_LIBTHREADAR_HPP
34 #include <libthreadar/libthreadar.hpp>
45 class slave_thread :
public libthreadar::thread,
public on_pool
53 slave_thread(generic_file *x_data,
54 libthreadar::fast_tampon<char> *x_input_data,
55 libthreadar::fast_tampon<char> *x_output_data,
56 libthreadar::fast_tampon<char> *x_input_ctrl,
57 libthreadar::fast_tampon<char> *x_output_ctrl);
58 slave_thread(
const slave_thread & ref) {
throw SRC_BUG; };
59 const slave_thread & operator = (
const slave_thread & ref) {
throw SRC_BUG; };
62 bool wake_me_up()
const {
if(wake_me) {
const_cast<slave_thread *
>(
this)->wake_me =
false;
return true; }
else return false; };
65 virtual void inherited_run();
69 libthreadar::fast_tampon<char> *input_data;
70 libthreadar::fast_tampon<char> *output_data;
71 libthreadar::fast_tampon<char> *input_ctrl;
72 libthreadar::fast_tampon<char> *output_ctrl;
74 messaging_encode answer;
75 messaging_decode order;
79 char data_header_completed;
81 bool endless_read_ahead;
82 infinint to_send_ahead;
88 void set_header_vars();
91 bool pending_order() {
return input_ctrl->is_not_empty(); };
92 bool pending_input_data() {
return input_data->is_not_empty(); };
93 void treat_input_data();
94 void ask_to_wake_me_up();
103 U_I send_data_block(U_I size,
bool & eof);
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
messaging_decode and messaging_encode are used to insert messages in a flow if data blocks ...
contains all the excetion class thrown by libdar
libdar namespace encapsulate all libdar symbols