libfilezilla
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
threaded_writer Class Reference

Base class for threaded writer. More...

#include <writer.hpp>

Inheritance diagram for threaded_writer:
Inheritance graph
[legend]
Collaboration diagram for threaded_writer:
Collaboration graph
[legend]

Public Member Functions

 writer_base (writer_base const &)=delete
 
 writer_base (std::wstring &&name, aio_buffer_pool &pool, progress_cb_t &&progress_cb, size_t max_buffers) noexcept
 
 writer_base (std::wstring_view name, aio_buffer_pool &pool, progress_cb_t &&progress_cb, size_t max_buffers) noexcept
 
- Public Member Functions inherited from writer_base
 writer_base (writer_base const &)=delete
 
writer_baseoperator= (writer_base const &)=delete
 
virtual aio_result preallocate (uint64_t)
 Instructs writer to preallocate storage. May be a noop.
 
aio_result add_buffer (buffer_lease &&b, aio_waiter &h)
 Pass a buffer to be written out. More...
 
aio_result add_buffer (buffer_lease &&b, event_handler &h)
 
aio_result finalize (aio_waiter &h)
 Finalizes the writer. More...
 
aio_result finalize (event_handler &h)
 
virtual bool set_mtime (datetime const &)
 Must be finalized already.
 
void close ()
 
- Public Member Functions inherited from aio_waitable
void remove_waiter (aio_waiter &h)
 
void remove_waiter (event_handler &h)
 

Protected Member Functions

virtual aio_result do_add_buffer (scoped_lock &l, buffer_lease &&b) override
 
virtual aio_result do_finalize (scoped_lock &l) override
 
void wakeup (scoped_lock &l)
 
virtual void do_close (scoped_lock &l) override
 
virtual aio_result continue_finalize (scoped_lock &)
 
- Protected Member Functions inherited from writer_base
 writer_base (std::wstring &&name, aio_buffer_pool &pool, progress_cb_t &&progress_cb, size_t max_buffers) noexcept
 
 writer_base (std::wstring_view name, aio_buffer_pool &pool, progress_cb_t &&progress_cb, size_t max_buffers) noexcept
 
- Protected Member Functions inherited from aio_waitable
void remove_waiters ()
 Call in destructor of most-derived class.
 
void add_waiter (aio_waiter &h)
 
void add_waiter (event_handler &h)
 
void signal_availibility ()
 

Protected Attributes

condition cond_
 
async_task task_
 
bool quit_ {}
 
- Protected Attributes inherited from writer_base
mutex mtx_
 
aio_buffer_poolbuffer_pool_
 
std::wstring const name_
 
progress_cb_t progress_cb_
 
size_t const max_buffers_ {}
 
std::list< buffer_leasebuffers_
 
bool error_ {}
 
uint8_t finalizing_ {}
 

Additional Inherited Members

- Public Types inherited from writer_base
using progress_cb_t = std::function< void(writer_base const *, uint64_t written)>
 
- Public Types inherited from aio_base
using size_type = uint64_t
 
- Static Public Attributes inherited from aio_base
static constexpr auto nosize = static_cast<size_type>(-1)
 

Detailed Description

Base class for threaded writer.


The documentation for this class was generated from the following file: