 |
Disk ARchive
2.6.8
Full featured and portable backup and archiving tool
|
Go to the documentation of this file.
27 #ifndef GENERIC_THREAD_HPP
28 #define GENERIC_THREAD_HPP
30 #include "../my_config.h"
48 static constexpr
unsigned int tampon_block_size = 102401;
49 static constexpr
unsigned int tampon_num_block = 1000;
50 static constexpr
unsigned int tampon_block_size_ctrl = 1024;
51 static constexpr
unsigned int tampon_num_block_ctrl = 10;
63 U_I data_block_size = tampon_block_size,
64 U_I data_num_block = tampon_num_block,
65 U_I ctrl_block_size = tampon_block_size_ctrl,
66 U_I ctrl_num_block = tampon_num_block_ctrl);
97 libthreadar::fast_tampon<char> toslave_data;
98 libthreadar::fast_tampon<char> tomaster_data;
99 libthreadar::fast_tampon<char> toslave_ctrl;
100 libthreadar::fast_tampon<char> tomaster_ctrl;
101 slave_thread *remote;
118 void check_answer(
msg_type expected);
120 void release_block_answer() { tomaster_ctrl.fetch_recycle(ptr); ptr =
nullptr; };
121 void release_data_ptr();
void purge_data_pipe()
drops all data in the toslave_data pipe
virtual void inherited_read_ahead(const infinint &amount) override
tells the object that several calls to read() will follow to probably obtain at least the given amoun...
manage label data structure used in archive slice headers
decoding received messages
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
the arbitrary large positive integer class
messaging_decode and messaging_encode are used to insert messages in a flow of data blocks
char data_header
contains 1 byte header for data
virtual U_I inherited_read(char *a, U_I size) override
implementation of read() operation
char data_header_eof
contains 1 byte header for data + eof
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
virtual bool skip_relative(S_I x) override
skip relatively to the current position
virtual infinint get_position() const override
get the current read/write position
encoding messages to be sent
void wake_up_slave_if_asked()
check whether an order to wakeup the slave has been received, and send wake up the slave
class generic_file is defined here as well as class fichier
virtual void inherited_sync_write() override
generic_file inherited method to sync all pending writes
let a generic_file be managed by another thread
virtual bool skip_to_eof() override
skip to the end of file
bool reached_eof
whether we reached end of file
this is the interface class from which all other data transfer classes inherit
virtual bool skip(const infinint &pos) override
skip at the absolute position
pthread_t tid
thread id of remote
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position
bool running
whether a remote is expected to run, tid is then set
class slave_thread is runs a I/O operations on a given generic_file in a separated thread
msg_type
the different types of messages
generic_thread(generic_file *ptr, U_I data_block_size=tampon_block_size, U_I data_num_block=tampon_num_block, U_I ctrl_block_size=tampon_block_size_ctrl, U_I ctrl_num_block=tampon_num_block_ctrl)
constructor
libdar namespace encapsulate all libdar symbols