28 #ifndef GENERIC_THREAD_HPP
29 #define GENERIC_THREAD_HPP
31 #include "../my_config.h"
42 class generic_thread :
public generic_file
46 static const unsigned int tampon_block_size = 102401;
47 static const unsigned int tampon_num_block = 1000;
48 static const unsigned int tampon_block_size_ctrl = 1024;
49 static const unsigned int tampon_num_block_ctrl = 10;
58 generic_thread(generic_file *ptr,
59 U_I data_block_size = tampon_block_size,
60 U_I data_num_block = tampon_num_block,
61 U_I ctrl_block_size = tampon_block_size_ctrl,
62 U_I ctrl_num_block = tampon_num_block_ctrl);
63 generic_thread(
const generic_thread & ref);
64 const generic_thread & operator = (
const generic_thread & ref) {
throw SRC_BUG; };
65 virtual ~generic_thread();
69 virtual bool skippable(skippability direction,
const infinint & amount);
70 virtual bool skip(
const infinint & pos);
71 virtual bool skip_to_eof();
72 virtual bool skip_relative(S_I x);
73 virtual infinint get_position()
const;
77 virtual void inherited_read_ahead(
const infinint & amount);
78 virtual U_I inherited_read(
char *a, U_I size);
79 virtual void inherited_write(
const char *a, U_I size);
85 virtual void inherited_sync_write();
86 virtual void inherited_flush_read();
87 virtual void inherited_terminate();
91 libthreadar::fast_tampon<char> toslave_data;
92 libthreadar::fast_tampon<char> tomaster_data;
93 libthreadar::fast_tampon<char> toslave_ctrl;
94 libthreadar::fast_tampon<char> tomaster_ctrl;
104 messaging_encode order;
105 messaging_decode answer;
112 void check_answer(msg_type expected);
113 void wake_up_slave_if_asked();
114 void release_block_answer() { tomaster_ctrl.fetch_recycle(ptr); ptr =
nullptr; };
115 void release_data_ptr();
116 void purge_data_pipe();
class slave_thread is runs a I/O operations on a given genercif_file in a separated thread ...
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